Well, I don't know what metacity is..... but I will give you some more information.

The Xt test program compiled on the RedHat 7 box or RedHat 8 box shows this
behavior when running against a RedHat 7 or 8 Xserver (XFree86-4.2.0-8 and XFree86-4.2.0-72 respectively)
It doesn't get these Enter/Leave's when running against an SGI Irix Xserver.
As you can see in my test code, I just use an Xawt labelWidget child of the toplevel, and
I XtAddEventHandler to the child.


Widget initialize(int *argc, char *argv[])
{
Widget top, w;

top = XtInitialize("xxt1", "Xxt1", NULL, 0, argc, argv);

context = _XtDefaultAppContext();
w = XtCreateManagedWidget("\n\n just a widget \n\n\n",
/*commandWidgetClass*/
labelWidgetClass, top, NULL, 0);

XtRealizeWidget( top );
dpy = XtDisplay(top);
return w;
}

void registerPointerEvents(Widget w)
{
Boolean nonMaskable = FALSE;
int mask = ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask |
PointerMotionMask;

XtAddEventHandler( w, mask, nonMaskable, dispatchEvent, 0);
}

int main(int argc,char *argv[])
{
Widget w = initialize(&argc,argv);
registerPointerEvents(w);
if(argc > 1) {
XDevice *device = lookupInputDevice(argv[1]);
registerDeviceEvents(device,w);
}
handleEvents();
return 0;
}

I think that you (Owen Taylor) told me the source of my trouble ... the window manager.
It is Gnome 1.4

I coudn't find any meaningfull difference in the XServer sources (-72 versus -8) nor in
the Xt client lib sources..., nor could I find a call of an XSendEvent under gdb
but I didn't have the idea of a possible interraction of the window manager.

Now that you told me, I think back about several problems we had with successive redhat releases
or people using their prefered wm (for example in java programs, windows beeing iconified
when mapped)

Now the question is: can this be considered as I bug of the wm ? and should it be solved ?
I would say yes, why should an application program see spurious events ?.

To be complete in my explainations, I describe the actual bug I have:

Motif/Xt paint program
uses mouse and wacom tablet at the same time
uses tablet events for brush (pressure) and also for digitizing with raw tablet coordinates
a working area widget selects Enter/Leave and tablet events (XIE)
digitizing a point happens when button4 of tablet is pressed (using a puck)
brushing happens when button 1 of tablet is pressed (or pressure threshold when using stylus)
Enter/Leave events are used to enable/disable handling of tablet events (motion, buttonPress/Release)

before Linux (on SGI and Sun) no pb.. I get things like

type: 4 ButtonPress button 1
type: 98 DeviceButtonPress button 1
type: 5 ButtonRelease button 1
type: 99 DeviceButtonRelease button 1

on Linux ( before RedHat 8.0) no pb...

type: 8 LeaveNotify
type: 7 EnterNotify
type: 4 ButtonPress button 1
type: 98 DeviceButtonPress button 1
type: 5 ButtonRelease button 1
type: 99 DeviceButtonRelease button 1
type: 8 LeaveNotify
type: 7 EnterNotify
type: 4 ButtonPress button 2
type: 98 DeviceButtonPress button 2
type: 5 ButtonRelease button 2
type: 99 DeviceButtonRelease button 2

there are leave/enter pairs I never noticed up to now, just because
they where harmless.

on RedHat 8.0 : PROBLEM

type: 8 LeaveNotify
type: 98 DeviceButtonPress button 1
type: 7 EnterNotify
type: 4 ButtonPress button 1
type: 5 ButtonRelease button 1
type: 99 DeviceButtonRelease button 1
type: 8 LeaveNotify
type: 98 DeviceButtonPress button 2
type: 7 EnterNotify
type: 4 ButtonPress button 2
type: 5 ButtonRelease button 2
type: 99 DeviceButtonRelease button 2

now the DeviceButtonPress is in between the leave and enter and
my app just doesn't pain anymore since it never sees a tablet press when in working area.












_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to