Hi Mark, I suspect that you are right - I think MetaCity is grabbing it, and causing my grab to crash. Is it easy to install another window manager, and which one would you recommend?
Thanks, Greg Greg Knight B.Sc.(Hons), C.Eng., C.I.S.P. Email: [EMAIL PROTECTED] URL: www.ConsultGregKnight.com INTERNET MAIL CONFIDENTIALITY This E-mail is covered by the Electronic Communications Privacy Act, 18 U. S. C. 2510-2521 and is legally privileged. This information is confidential information and is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Vojkovich Sent: Thursday, January 15, 2004 11:51 PM To: [EMAIL PROTECTED] Subject: Re: XGrabButton() BadAccess error This is not my area of expertise, but the man page and X-server code suggest that this only happens when this button is already grabbed by another client. That means either you double grab in your app using separate display connections, or another app is grabbing it. Have you tried running with a different window manager? Mark. On Thu, 15 Jan 2004, Greg Knight wrote: > Hi Folks, > > I have inherrited some old(ish) code, and am having some trouble > getting it working. I am assured this code has worked in the past, but > I now get a BadAccess error running the code with XFree86 in RedHat v9 > Professional. As I am not an expert in X/Xt, I would appreciate some > help in telling me where it is wrong, and suggestions for quickly > getting it working again! Many thanks! > > I have summarised the key calls of the failing code below. As you can > see, the program opens a control panel via Xt, then opens a Big window > (for graphics & text) via X. Mouse events in the Big window used to be > read via the XtAppNextEvent() call, after an XGrabButton() call had > been made, but the call to XGrabButton() is now failing with a > BadAccess, so we never see the events from the Big window. > > If I use the CWOverrideRedirect option (which seems a strange thing to > do on a big display window like this), then the XGrabButton works OK, > but (as you might expect) the Big window has no title or borders & is > always on top (not what we want). > > Here is the sequence of the major calls: > > > toplevel = XtAppInitialize(&XControlPanel,"XB", > options,XtNumber(options),&GlobalArgC,GlobalArgV, > NEfallback_resources,APargs,SIX); > > /* open another channel to the server via the same application context - > hence allowing the toolkit to process the mouse (etc.) events */ > if((TheXDisplay = XtOpenDisplay(XControlPanel,NULL, > "XB","ACompany",options,XtNumber(options),&GlobalArgC, > GlobalArgV)) == NULL) > { > // error handling & tidy up > } > > XRootWin = DefaultRootWindow(TheXDisplay); > ScreenNumber = XDefaultScreen(TheXDisplay); > > XBigWindowAttr.backing_store = Always; > XBigWindowAttr.save_under = True; > XBigWindowAttr.event_mask = ButtonReleaseMask; > > XBigWindow = > XCreateWindow(TheXDisplay,XRootWin,0,0,BITMAPWIDTH,BITMAPHEIGHT,XWINBO > RDERWI > DTH, > BigWindowDepth,InputOutput,(Visual > *)XBigWindowVisual, > CWSaveUnder | CWBackingStore | CWBackPixel| > CWBorderPixel | CWColormap > | CWEventMask, > &XBigWindowAttr); > /* now let's map the window */ > if((XIntError = XMapRaised(TheXDisplay,XBigWindow)) != Success) > { > // error handling > } > > if((XIntError = > XGrabButton(TheXDisplay,JNSBUTTONS,JNSKMODS,XBigWindow,False, > > Button1Mask,GrabModeAsync,GrabModeAsync,None,None)) != Success) > { > // error handling > } > > // Event Handling ... > > while(0 == 0) > { > XtAppNextEvent(XControlPanel,&TheEvent); > // etc > } > > ---------------------------------------------------------------------- > ---- > > The exact error message from XGrabButton() is: > > X Error of failed request: BadAccess (attempt to access private > resource > denied) > Major opcode of failed request: 28 (X_GrabButton) > > > I'm hoping this is something simple, and I appreciate help in getting > this running again. > > Many thanks, > > Greg > > _______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel _______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel