drawing area and motion hint mask
- From: Emmanuel Touzery <emmanuel touzery free fr>
- To: gtk-app-devel-list gnome org
- Subject: drawing area and motion hint mask
- Date: Wed, 29 Jul 2009 23:04:59 +0200
Hello,
I'm trying to detect mouse moves in a drawing area. The default
behaviour without the GDK_POINTER_MOTION_HINT_MASK is as expected
flooding me with events which I can't handle.
So I added that flag, but I still get way too many events.
In my handler I put this at the top:
printf ("got mouse move (%d)!\n", event->is_hint);
And when I don't set the HINT_MASK then is_hint is 0, if I set the
HINT_MASK then it's 1.
So it seems I'm setting the hint properly.
That I'm getting more events (not just one, because I never call
gdk_event_request_motions() or gdk_window_get_pointer() anywhere in my
code) it seems somehow someone else is calling
gdk_event_request_motions() or gdk_window_get_pointer() (the examples on
internet are not really clear on which one to call, or both, maybe this
changed in the past?).
So I put a breakpoint on both those methods in GDB. And indeed I'm
hitting very often this call:
#0 IA__gdk_window_get_pointer (window=0x88bdde8, x=0xbff3aef8,
y=0xbff3aef4,
mask=0x0) at /build/buildd/gtk+2.0-2.16.1/gdk/gdkwindow.c:3315
#1 0xb7c300f0 in IA__gdk_device_get_state (device=0x849c840,
window=0x88bdde8, axes=0x0, mask=0x0)
at /build/buildd/gtk+2.0-2.16.1/gdk/x11/gdkinput-x11.c:788
#2 0xb7be5db4 in IA__gdk_event_request_motions (event=0x849c840)
at /build/buildd/gtk+2.0-2.16.1/gdk/gdkevents.c:889
#3 0xb7e657d0 in _gtk_tooltip_handle_event (event=0x887b0c0)
at /build/buildd/gtk+2.0-2.16.1/gtk/gtktooltip.c:1287
#4 0xb7d8720d in IA__gtk_main_do_event (event=0x887b0c0)
at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c:1643
#5 0xb7c1434a in gdk_event_dispatch (source=0x849c358, callback=0,
user_data=0x0) at
/build/buildd/gtk+2.0-2.16.1/gdk/x11/gdkevents-x11.c:2364
#6 0xb78a7b88 in IA__g_main_context_dispatch (context=0x849c3a0)
at /build/buildd/glib2.0-2.20.1/glib/gmain.c:1814
#7 0xb78ab0eb in g_main_context_iterate (context=0x849c3a0, block=1,
dispatch=1, self=0x8483b80)
at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2448
#8 0xb78ab5ba in IA__g_main_loop_run (loop=0x8611fb0)
at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2656
#9 0xb7d877d9 in IA__gtk_main ()
at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c:1205
Something about tooltips. I don't have any tooltips for now in the
application and certainly not in this drawing area...
So I don't understand how come that tooltip code is getting called.
It prevents me from completely controlling when I'm getting mouse move
events. That said, I'm surely getting much less events than before and
maybe it's "expected". It does complicate my life though. Is there a way
to avoid this? What am I doing wrong?
I can't send the complete source of that program for now, it's
already bigger. I'm hoping that it's obvious enough that someone can
answer it without me having to extract the problem in a test program.
Thank you!
emmanuel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]