Disabling drag events?
Owen Taylor
otaylor at redhat.com
Fri Mar 10 15:58:12 PST 2006
On Fri, 2006-03-10 at 11:11 -0500, 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.
I would strongly advise making any changes you make at one of two
levels ... either at the toolkit level, or at a very low level, right
after the events come in from the device.
That is, take the raw events coming from the device and munge them
to look like the user released the "mouse button" immediately.
Depending on the particulars of the events, this may be as simple
as faking a button release event after every button press and discarding
all real button releases.
If you try to muck with event delivery in the "dix" layer of X, you
are very likely to upset delicate guarantees that toolkits rely upon
and may cause stuck pointer grabs and similar.
Owen
(It's not clear to me what the dangers of click-and-drag are. There
will be a "touchscreen mode" in the next version of GTK+ that modifies
various toolkit behaviors to work better on touchscreen devices, but
that is mostly to deal with the fact that you don't get motion events
*except* when the "mouse button" is down.)
More information about the xorg
mailing list