Path: utzoo!attcan!uunet!island!argv From: argv@island.uu.net (Dan Heller) Newsgroups: comp.windows.x Subject: Re: Unwanted Enter/Leave events during XGrabPointer Message-ID: <495@island.uu.net> Date: 24 Nov 88 08:33:15 GMT References: <278@stan.com> <8811171510.AA13680@EXPO.LCS.MIT.EDU> Reply-To: argv@island.uu.net (Dan Heller) Organization: Island Graphics, Marin County, California Lines: 38 In article <8811171510.AA13680@EXPO.LCS.MIT.EDU> rws@EXPO.LCS.MIT.EDU (Bob Scheifler) writes: > > My reading of the event mask passed to XGrabPointer says the Enter/Leave > events should be discarded; is there something I am missing here? > >Nope, 'tis a bug, plain and simple. I know where the bug is, and >basically how to fix it, but it will probably be a little while >before you see a fix. But is it a bug? I depend on this for at least one use. I have widgets which need to know whether or not you are inside of the widget's bounding box. If you leave it, it needs to dehighlight, XtRemoveTimeOut, etc... For example, say I have a widget which is an "Open File" command-type widget. I am inside the widget, I click on it, and the callback routine tries to open a file. At this point, the code is part of the applciation, _not_ in the user interface. The application knows nothing of the user interface layer, but if it fails to open the file, then it needs to know what to do next by caling a "generic" routine which asks, "create the file?" To do this without relinquishing control back to the top level, the application calls a routine which creates a dialog box which is a popup widget that has yes/no widgets and a small MainLoop()-type loop. It grabs _all_ the events to prevent the user from doing anything else in the application besides clicking on yes or no. When the user goes to click on yes or no, he has left the "Open File" widget which started all this. This widget needs to know that the user has left its boundaries so it can reset itself. How is this supposed to work if I can't get enter/exit window events? Obviously, supressing such events is desired, but in cases as I've described, you need those events. Perhaps it would be a good idea to tell the server which window is doing the grabbing and then allow that window to have enter/exit events... ? -- --dan :-) :-( :-| Have a nice day. Have a bad day. Have a day.