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 663396 - With multiple master devices, right clicking may show popup in the wrong place.
With multiple master devices, right clicking may show popup in the wrong place.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-11-04 13:34 UTC by arno
Modified: 2011-11-05 11:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcas (1.00 KB, text/x-csrc)
2011-11-04 13:34 UTC, arno
  Details
patch proposal (1.87 KB, patch)
2011-11-04 13:37 UTC, arno
reviewed Details | Review
Pop up context menus at the right device (2.96 KB, patch)
2011-11-05 05:24 UTC, Matthias Clasen
committed Details | Review

Description arno 2011-11-04 13:34:29 UTC
Created attachment 200687 [details]
testcas

Hi,
If, thanks to xi2, I have two master pointers, and I right click on a text view with a pointer, clipload popup is sometimes displayed near the other pointer.
That's because gtk uses the first pointer it finds.
We can fix this by using gtk_menu_popup_for_device and passing the correct device.
Comment 1 arno 2011-11-04 13:37:49 UTC
Created attachment 200689 [details] [review]
patch proposal
Comment 2 Matthias Clasen 2011-11-05 05:24:36 UTC
The following fix has been pushed:
41d4229 Pop up context menus at the right device
Comment 3 Matthias Clasen 2011-11-05 05:24:39 UTC
Created attachment 200736 [details] [review]
Pop up context menus at the right device

When multiple pointers are in play, we need to be careful
not to loose track of the device between receiving a button
press and popping up a menu.
Comment 4 Carlos Garnacho 2011-11-05 11:54:41 UTC
Review of attachment 200689 [details] [review]:

Thanks for the patch, it looks mostly good

::: gtk/gtktextview.c.old
@@ +8342,3 @@
       info->button = 0;
       info->time = gtk_get_current_event_time ();
+      info->device = NULL;

In the else case here, this function is most likely called by ::popup-menu, so it's triggered by a keyboard event, you could better resort to:

keyb = gtk_get_current_event_device ();

if (keyb && gdk_device_get_source (keyb) == GDK_SOURCE_KEYBOARD)
  info->device = gdk_device_get_associated_device (keyb);
Comment 5 Carlos Garnacho 2011-11-05 11:56:12 UTC
Oh, this came across too late, had this bug opened since yesterday...