[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

2668.0. "Unwanted Leave and Enter events when MB1 pressed in Window" by SCOTMN::WOOD (El Vaquero) Thu Apr 26 1990 16:20

( VMS v5.3-1 DW v2 )

  Hi there again,
		 I have a customer who has come accross an interesting
problem. He has a DwtMainWindow which is enabled for ButtonPress, ButtonRelease,
LeaveNotify and EnterNotify. When pressing MB1 inside the MainWindow,
3 events are returned. Instead of just the ButtonPress, you also get
a LeaveNotify and EnterNotify. This doesn't happen with any other button
except when changing from a right-handed mouse to a left-handed one (ie.
the extra events are returned with MB3 instead).

  Also the problem does not occur when NOT running a window manager. It
appears to be the way the window manager handles keyboard focus. Does
anybody have any explanations or suggestions ?

Thanks for any info

Richard
T.RTitleUserPersonal
Name
DateLines
2668.1come from grabsTOOLEY::B_WACKERThu Apr 26 1990 20:172
It is intended behavior.  See Scheifler... p.227 section 8.4.2.2 on 
grabs.
2668.2Scheifler ??SCOTMN::WOODEl VaqueroFri Apr 27 1990 07:427
  Thanks for the info, I'll do some reading, although I don't know that
particular book ( is it worth getting ?). Would the only way of handling
this be to ignore <Enter> and <Leave> when associated with
<MB1down> ?

Richard
2668.3Order # EY-6737E-DPSCAM::DIALFri Apr 27 1990 12:574
    X Window System, C Library and Protocol Reference, by Robert W.
    Scheifler, James Gettys and Ron Newman.  Digital Press, order #
    EY-6737E-DP, ISBN 1-55558-012-2.  A good, very technical book about X.
    
2668.4GILROY::kleeKen LeeFri Apr 27 1990 17:172
This book also appears, with very minor differences, on the X tape from
MIT and in the DEC UWS (VMS too?) document set.
2668.5Any Work AroundSCOTMN::WOODEl VaqueroMon Apr 30 1990 12:557
Thanks for the replies,

Does anybody know a way around this problem. Would the only way be to
write code to filter out the '<Leave><Enter>' events that precede <MB1Down> ?

Richard
2668.6event tells allTOOLEY::B_WACKERMon Apr 30 1990 14:242
I'm pretty sure the event structure, itself, has enough information to 
figure out if it is "real" or not, but don't remember the details.
2668.7Ignore events you are not interested in...LEOVAX::TREGGIARIMon Apr 30 1990 14:4313
> I'm pretty sure the event structure, itself, has enough information to 
> figure out if it is "real" or not, but don't remember the details.

That is correct.  If you look in X.h you'll see a number of Notify*
literals that come back in one of the fields of the event and will
allow you to distinguish between different types of Enter/Leave events.
But only worry about it if you need to handle Enter/Leave events for
some other reason.  The toolkit, for example, uses and encourages a style
of programming where you specify the events that you are interested in
(via event handlers or translation management) and just "drops" any other
event "on the floor".

Leo
2668.8Check the mode field of Event StructureCSC32::B_KEMPI just answer the phoneMon Apr 30 1990 16:2014
    The way to test if there is an actual entry/leave event or a 
    'pseudo' leave/entry event is to check the mode field of the
    event structure.
    
    pages 227-228 of Scheifler:
    " Pseudo-motion mode EnterNotify and LeaveNotify events are generated
    when a pointer grab activates or deactivates.  Events in which the
    pointer grab activates are identified by XEnterWindowEvent or
    XLeaveWindowEvent structures whose mode member is set to NotifyGrab.
    Events in which the pointer grab deactivates are identified by
    XEnterWindowEvent or XLeaveWindowEvent structures whose mode member is
    set to NotifyUngrab(see XGrabPointer)."
    
    -Bill
2668.9Another Problem solved !!SCOTMN::WOODEl VaqueroThu May 03 1990 11:489

  Thanks to all concerned, checking the 'mode' field in the XCrossingEvent
data structure for 'NotifyNormal' enables filtering of these particular
events.

Cheers for now

Richard