[racket-dev] mouse motion events in Linux

From: Stephan Houben (stephanh at planet.nl)
Date: Mon Jul 18 03:29:31 EDT 2011

Hi Matthew,

On 07/17/2011 04:12 PM, Matthew Flatt wrote:

> Does adding GDK_POINTER_MOTION_HINT_MASK change the mouse events that
> you see on your machine?

No, in fact it does not. You are right; the behaviour of
GDK_POINTER_MOTION_HINT_MASK appears not to match the docs.

I investigated this under gdb and discovered that GTK itself
calls gdk_window_get_pointer (as you suspected):

#0  IA__gdk_window_get_pointer (window=0x8351520, x=0xbfffd7a4, y=0xbfffd7a0, mask=0x0)
     at /build/buildd/gtk+2.0-2.24.4/gdk/gdkwindow.c:6502
#1  0x00a992e3 in IA__gdk_device_get_state (device=0x8353808, window=0x8351520, axes=0x0, mask=0x0)
     at /build/buildd/gtk+2.0-2.24.4/gdk/x11/gdkinput-x11.c:886
#2  0x00a44df9 in IA__gdk_event_request_motions (event=0x839eb30) at /build/buildd/gtk+2.0-2.24.4/gdk/gdkevents.c:954
#3  0x00e77950 in _gtk_tooltip_handle_event (event=0x839eb30) at /build/buildd/gtk+2.0-2.24.4/gtk/gtktooltip.c:1605
#4  0x00d86f20 in IA__gtk_main_do_event (event=<value optimized out>) at /build/buildd/gtk+2.0-2.24.4/gtk/gtkmain.c:1727
#5  0x0015d357 in ffi_call_SYSV () at ../src/x86/sysv.S:61

So in fact the GTK tooltip code calls gdk_window_get_pointer and thereby triggers delivery of more events.
Even if you don't use the GTK tooltip functionality, apparently.

So it appears that GDK_POINTER_MOTION_HINT_MASK is broken by this or at least doesn't work
as advertised.

> More generally, since adding
> GDK_POINTER_MOTION_HINT_MASK didn't seem to change anything, the safest
> course seemed to be leaving it out

I agree completely.

Stephan


Posted on the dev mailing list.