Disabling drag events?

Peter Hutterer mailinglists at who-t.net
Fri Mar 10 17:27:16 PST 2006


What you could do is modify the event creation that a motion event  
never has the buttons set. this disables drag events at any level.

if you look at xserver/xorg/dix/events.c into DeliverDeviceEvents(),  
there is a statement looking like this:
	deliveries = DeliverEventsToWindow(pWin, xE, count, filter, grab, 0);

xE is the event that is to be sent (if count > 1) it is more than one  
event. You could take this event, check for the type and if it is a  
MotionNotify (or DeviceMotionNotify) change the button states.

Additionally you may want to look at DeliverGrabbedEvent() and do the  
same before the line:
	deliveries = TryClientEvents(rClient(grab), xE, count, (Mask)grab- 
 >eventMask, filters[xE->u.u.type], grab);


However, when you consider doing that I'd seriously consider buying  
some band-aid too because chances that you shoot yourself in the foot  
are very high.

Cheers,
   Peter


On 11/03/2006, at 2:41 AM, Kit Peters wrote:

> Interesting. OK, let me define "drag event," then, and then perhaps  
> someone can tell me where I need to look from there, whether it's  
> in the X sources or somewhere else.
>
> I define a drag event to be a motion event (as previously defined  
> by Owen Taylor) where throughout the duration of the motion event,  
> a button on an input device remains in the pressed state.
>
> An example of a drag event would be the event that takes place when  
> I click and hold my left mouse button and move it across a line of  
> text to highlight it.  Another example of a drag event would be the  
> event that takes place when I click on a file icon in Konqueror and  
> drag the file icon on top of another file icon.
>
> Does this clarify things?
>
> On 3/10/06, Owen Taylor <otaylor at redhat.com> wrote:
> There is no such thing as a drag event in X. You get "motion" events,
> when the pointer is moved and which are independent from the state of
> the button or buttons.
>
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg




More information about the xorg mailing list