After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 643769 - map plugin doesn't react to mouse events
map plugin doesn't react to mouse events
Status: RESOLVED FIXED
Product: eog-plugins
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-03 10:44 UTC by Felix Riemann
Modified: 2019-02-22 03:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Felix Riemann 2011-03-03 10:44:04 UTC
+++ This is a follow-up-bug of bug #642802 +++

After porting of the map plugin to libchamplain 0.10 / gtk-3 (see bug 642802) the plugin's map view doesn't react to mouse events anymore. This makes it unable to move the map or select a different image by clicking it on the map.

After some investigation libchamplain was so far ruled out as the cause of this (bug 642802 comment 16) and a bug against Clutter was opened due to some strange behaviour in its event handling: http://bugzilla.clutter-project.org/show_bug.cgi?id=2582

If at the end this stays a bug in Clutter or any other component (gtk+, libchamplain,...) this bug can operate as a tracker bug for eog-plugins.
If it turns out to be an error in the plugin the fix can be handled through this bug.

*CCing subscribers of original bug*
Comment 1 Matthias Clasen 2011-03-04 23:02:23 UTC
are you using an event filter there ?

if yes, this might well be caused by gtk using xi2 by default now, ie you don't get core events anymore. 

to test that theory, try calling gdk_disable_multidevice() before gtk_init() and see if that fixes things.
Comment 2 Felix Riemann 2011-03-06 15:14:16 UTC
Yes, gdk_disable_multidevice() makes it work again. Does using gdk_disable_multidevice() qualify as a fix or this a workaround-function?

Also, I was under the impression that Clutter supports XI2.
Comment 3 Matthias Clasen 2011-03-07 15:00:30 UTC
(In reply to comment #2)
> Yes, gdk_disable_multidevice() makes it work again. Does using
> gdk_disable_multidevice() qualify as a fix or this a workaround-function?

Not a fix/workaround, just a diagnostic, really.
Comment 4 Jiri Techet 2011-03-08 22:58:55 UTC
This is actually how gtk_clutter_init() starts:

ClutterInitError
gtk_clutter_init (int    *argc,
                  char ***argv)
{
  gdk_disable_multidevice ();

  if (!gtk_init_check (argc, argv))
    return CLUTTER_INIT_ERROR_UNKNOWN;
...


Is it possible that we experience this bug in eog because gtk_clutter_init() is called after the plugin is initialized which is after gtk_init() of eog is called so the gdk_disable_multidevice() has no effect? Something like that might also happen with the python bindings where the bindings themselves perform some initialization in wrong order.

And yes, in gtk-clutter-embed.c there are really some event filters used but unfortunately I don't know anything about what changes in GTK have caused the bug and how the code should be changed. 

Any more ideas how to fix this?
Comment 5 Emmanuele Bassi (:ebassi) 2011-03-09 00:03:26 UTC
• clutter does not use xi2 by default; it has to be explicitly enabled by calling clutter_x11_enable_xinput() before calling clutter_init().

• yes, if gtk_init() has already been called then gdk_disable_multidevice() will not be useful.

how to fix this? well, I have no idea :-)

clutter-gtk uses a global filter function to pass the native XEvent directly to Clutter; if gtk+ has multi-device support enabled, then gtk_clutter_init() should call clutter_x11_enable_xinput() - but then event handling won't work (I've already tested it).

all I can think of is trying to figure out *why* XI2 does not work for Clutter when embedded inside a GdkWindow; there must be a piece of API that makes GDK pass all the events to the filter function - and that clutter-gtk should always call.

tracing the event window, and see if it matches the stage, as well would help.
Comment 6 Robert Bruce Park 2011-03-09 01:54:40 UTC
LOL -- maybe this is obvious to you super-hackers, but I thought I'd just try this out on a lark. I added ClutterX11.enable_xinput() before my GtkClutter.init([]), based on what Emmanuele said, and then when I ran my program... the map worked! ... but then Gtk couldn't receive any mouse or keyboard inputs at all.

One step forward and two steps backwards, it seems...
Comment 7 Felix Riemann 2011-12-14 15:42:46 UTC
So, I just gave it a go with latest Clutter,Clutter-GTK and libchamplain and it worked once clutter_x11_enable_xinput() was called by the plugin (or enable through the env var).

The last problem I see here is, that it requires the plugin to be the first to initialize Clutter at least until eog uses Clutter-Gtk itself (and would then have to enable XI). Is there a way to see if Clutter has been initialized and/or XInput-support enabled? That way we could print an error message declaring non-working input in the map if we are too late.
Comment 8 Felix Riemann 2012-02-03 16:44:52 UTC
As it turned out that recent versions of Clutter and Clutter-GTK fix it on their own I just raised the plugins minimum versions:

commit 6d2671f7dfbe198567e9405328b00d9b8eb9f229
Author: Felix Riemann <>
Date:   Fri Feb 3 17:22:55 2012 +0100

    map: Raise Clutter and Clutter-GTK dependencies
    
    Although the plugin could run using older versions of these libraries,
    it will not react to input events for the map widget then.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=643769

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 9 Jiri Techet 2012-02-05 21:12:51 UTC
That's good news, thanks for your investigation!