Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!iuvax!pur-ee!uiucdcs!uiucdcsm!grogers From: grogers@uiucdcsm.cs.uiuc.edu Newsgroups: comp.windows.x Subject: Event Questions Message-ID: <26900019@uiucdcsm> Date: Tue, 10-Nov-87 16:47:00 EST Article-I.D.: uiucdcsm.26900019 Posted: Tue Nov 10 16:47:00 1987 Date-Received: Fri, 13-Nov-87 22:05:35 EST Lines: 53 Nf-ID: #N:uiucdcsm:26900019:000:1958 Nf-From: uiucdcsm.cs.uiuc.edu!grogers Nov 10 15:47:00 1987 I am writing an application that cannot follow the usually X11 model of polling for events, e.g. for(;;) { while (XPending(dpy)) { XNextEvent( dpy, &xevent); switch( xevent.type) { ... process events ... } } do non-event processing. } Yet, I still need to know when some events happen (e.g. expose). So, what I am currently doing is using SIGIO on the dpy->fd. This all seems to work ok, but I have a few questions: - Is there a better solution than using SIGIO? (Here's the really important one...) - Does the server send ALL events to the client and let the Xlib filter out the events not requested by the application or does the mask get applied at the server level? Really I'm asking if it costs me anything to enable events and then ignore them (especially expensive if the event causes a SIGIO interrupt and then is ignored). - I'm I supposed to be able to change the event mask after a ButtonPress event but before a ButtonReleased event? For example, after a ButtonPress I want to drag something across the screen by watching the MotionNotify events until a ButtonReleased event. My problem is this, after the ButtonPress event, if I change the event mask via XGetWindowAttributes, and XSelectInput or XChangeWindowAttributes I do not get any MotionNotify events. [I've verified that the new mask is set correctly by a second call to XGetWindowAttributes.] However, if I accept MotionNotify events before the ButtonPress event comes, everything works as expected (i.e. I get the events.) Anyway, Since I'm using ButtonMotionMask it doesn't really matter if this mask is enabled before a ButtonPress event because MotionEvents will only come when the button is down and that's just what I want. Greg Rogers University of Illinois at Urbana-Champaign Department of Computer Science UUCP: {pur-ee,convex,inhp4}!uiucdcs!grogers ARPA: grogers@m.cs.uiuc.edu CSNET: grogers%uiuc@csnet-relay