Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!hellgate.utah.edu!dog.ee.lbl.gov!nosc!manta!kadel From: kadel@manta.NOSC.MIL (Rich Kadel) Newsgroups: comp.windows.x Subject: XSendEvent followup -- problems with masks Message-ID: <1496@manta.NOSC.MIL> Date: 6 Dec 90 02:34:42 GMT Reply-To: kadel@manta.nosc.mil.UUCP (Rich Kadel) Distribution: usa Organization: BTG, Inc. -- San Diego Lines: 31 This is to followup my previous posting on my problems getting XSendEvent to work. I had to put the server into debug to figure this one out. My problem was with the event mask parameter. As instructed in Doug Young's book (Xt programming/Motif Edition), I gave it the value "XtAllEvents". This doesn't work (at least in X11R4--no offense Doug). The simple solution is to use NoEventMask when sending a client message. OK. For anyone that's interested, here's why it doesn't work (I don't know whether I'd call this a bug or not, but it IS misleading): Client sees: #define XtAllEvents ((EventMask) -1L) /* 0xFFFFFFFF */ Server sees (in dix/events.c): #define OwnerGrabButtonMask (1L<<24) #define AllEventsMask (lastEventMask|(lastEventMask-1)) /* 0x1FFFFFF */ lastEventMask = OwnerGrabButtonMask; in server function ProcSendEvent(): if (stuff->eventMask & ~AllEventMasks) return BadValue; This check stops events with the supplied mask XtAllEvents! I suggest that XtAllEvents should be defined more explicitly in the future. "Thanks!" to those who responded so quickly to my question. (P.S. I don't know why XIconifyWindow() didn't work for me. It looks like it should have. I'll try it again later.) Rich Kadel