[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1220.0. "problem with events" by ANNECY::SIRON () Wed Aug 02 1989 12:56

I work on a VAXstation 3100 under VMS version 5.1.

if you :
  - create a window widget in a UIL module,
  _ specify the ButtonPressMask | LeaveWindowMask in the XtAddEventHandler
    routine,
then, when you click MB1 in the window widget, the first event that occurs 
is not ButtonPress but LeaveNotify.
This doesn't occur with the MB2 or MB3 button.

T.RTitleUserPersonal
Name
DateLines
1220.1AITG::DERAMODaniel V. {AITG,ZFC}:: D'EramoWed Aug 02 1989 14:5315
        If the mouse button is grabbed, and you press it, then you should
        see a leave event and an enter event before the button-press event.
        With our window manager, if you press MB1 on the window, you should
        see those events.  I believe it is the proper server behavior.  There
        is a field in the leave and enter event that enables one to
        distinguish between "grab" leave and enter events and "real" ones.
        The "mode" is either NotifyNormal or NotifyGrab.  I have Dave
        Burleigh's demo that will show this, just copy EVENTS.* from
        ZFC::ZFC$DISK1:[PUBLIC.TBD1].

        Maybe the idea was that the grabbed pointer "left" the window to
        click on a window manager window [??] and then "came back."

        Dan

1220.2other question !ANNECY::SIRONWed Sep 13 1989 06:5817

        I've got an other problem !

        I :
          - create a window widget in a UIL module.
          - specify the ButtonPressMask | MotionNotifyMask in the
            XtAddEventHandler routine.

        Then, if i move out of the window while MB1 is pressed, the
        callback procedure is called with the MotionNotify event's
        type, despite of the fact that :
          - i'm out of the window.
          - i didn't specifie the ButtonMotionMask.

        Any help welcome. Thanks.

1220.3Implicit "Grab"LEOVAX::TREGGIARIWed Sep 13 1989 08:519
    The reason this happens is because the server does an implicit
    grab when the button is pressed.  You can read about this in an
    Xlib or X Protocol manual under button events.  If you don't
    want this to happen, then you can call XUngrabxxxxx (where I
    *think* "xxxxx" is "Pointer") in your event handler when you
    get the button press event.
    
    Leo

1220.4More on unsolicited eventsDECWIN::KLEINWed Sep 13 1989 12:0917
I agree with Leo's diagnosis (the implicit grab), but calling XUngrab*
is not a complete solution.  Because the client to server communication
is asynchronous, it is possible (even likely) that the server will have
sent some motion events to the client before receiving the XUngrab
request.

What this means is that the client (your application) must be prepared
to receive (and ignore) extraneous motion events, even if you issue
the XUngrab request immediately upon receipt of the ButtonPress event.

In general, applications must be prepared to receive (and ignore)
unsolicited events.  This is especially true within widgets that
might have their event mask changed by the application through
the use of XtAugmentTranslations and its friends.

-steve-