GNOME Bugzilla – Bug 643510
Map does not respond to most mouse events
Last modified: 2011-03-28 22:06:37 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=642802 http://bugzilla.clutter-project.org/show_bug.cgi?id=2582 Here's the simplest reproducer that allows absolutely no mouse interactions: $ jhbuild run python Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from gi.repository import Gtk, GObject, GtkClutter, GtkChamplain Gtk-Message: Failed to load module "pk-gtk-module" >>> GObject.threads_init() >>> GtkClutter.init([]) (<enum CLUTTER_INIT_SUCCESS of type ClutterInitError>, []) >>> window = Gtk.Window() >>> embed = GtkChamplain.Embed() >>> window.add(embed) >>> window.show_all() >>> Gtk.main() So, with my application, I can't drag or zoom the map by mouse, and my ChamplainLabels aren't responding to mouse-in/out events, and they're not responding to click or drag events, however there is something quite peculiar going on. Somehow, scrolling the mouse over a ChamplainLabel is triggering the leave-event signal, because I'm able to shrink the labels by scrolling the mouse wheel over them (the signal handler for leave-event scales the ChamplainLabel down by 5% and that is clearly happening). Here's a screencast for you. Note at first how mousing over the Labels has no effect on them, and then the mouse cursor stays mostly still while the Label under it starts changing size, that's me using the mouse wheel. Then when the view starts moving, that's keyboard navigation. http://exolucere.ca/no-mouse.ogv Any type of click, be it left, middle, or right button, or scrolling the wheel, all emit both enter-event and leave-event, however scrolling the wheel tends to emit leave-event more often than enter-event, resulting in my Labels shrinking. Clicking keeps them the same size because the two events are paired and cancel each other out. The button-press signal or the dragging signals never fire, and enter/leave-event don't fire for actual mouse hover actions.
Robert, do you experience this bug also when you revert to libchamplain 0.9.0? I definitely do which means that the fixes of https://bugzilla.gnome.org/show_bug.cgi?id=638652 couldn't introduce it. This means that the bug must be in something different in the system. Also, can you confirm that the python test example here http://bugzilla.clutter-project.org/show_bug.cgi?id=2582 doesn't emit the event for you? (This example is just plain clutter so if it doesn't work then there's probably no bug in libchamplain. Please check whether it's correct - I'm not so much familiar with Python bindings for GTK and clutter.) To your question why we experienced the bug in eog several days before you: just a guess - maybe you were doing "jhbuild buildone libchamplain" for several days so the remaining packages were several days old and then you did full "jhbuild build libchamplain" which updated the rest of the system and introduced the bug. Was it like that?
Forgot to mention - I also tried to revert clutter to 1.4 and recompile but the bug was still present. So maybe it's GTK or something else.
That python reproducer you mention, yes, clicking on it does not fire the event. I modified it to also connect to enter-event and I get the same behavior where scrolling the mouse wheel fires enter-event. So that's identical. Also, you're right, I checked out 0.9.0 and I still experience the same problem, so it sure doesn't seem like this is a problem with libchamplain. As for why the bug took an extra week to bite me, I don't recall exactly whether I was using buildone or just build that week. I normally don't use buildone at all but I suppose it's possible that I was then. Reading back to https://bugzilla.gnome.org/show_bug.cgi?id=638652#c25 I vaguely recall the map working briefly before the mouse issue hit. I don't think I would have said 'excellent work' if my experience was that we went straight from redraw problems to mouse problems. I think that there were a few shining moments there when the redraw problem was solved and everything seemed magical, and then the mouse broke after I posted comment 25.
J5 posted a workaround for this bug to the mailing list, which I have adapted to this in my own code: from gi.repository import GObject, GtkClutter, Clutter GObject.threads_init() GtkClutter.init([]) from gi.repository import Gtk, Gdk, GdkPixbuf from gi.repository import GtkChamplain, Champlain The important bit here is that GtkClutter.init([]) is called before Gtk is imported. Also marking this resolved because it's not a bug in libchamplain at all.