| Summary: | [GTK] Menu appears at mouse regardless of setLocation() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Eric Williams <ericwill> | ||||
| Component: | SWT | Assignee: | Eric Williams <ericwill> | ||||
| Status: | VERIFIED FIXED | QA Contact: | Eric Williams <ericwill> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | brotenet, loskutov | ||||
| Version: | 4.8 | ||||||
| Target Milestone: | 4.8 M7 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431423 https://bugzilla.gnome.org/show_bug.cgi?id=791845 https://bugs.eclipse.org/bugs/show_bug.cgi?id=532074 https://git.eclipse.org/r/118813 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9c6346c33b2ceab571983d3f58db7ceed75a22e8 https://git.eclipse.org/r/119826 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=47598b7e6318e7cfae9c33fcf18610194b1c4741 |
||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Just wondering about bug 431423, where the menu does NOT appears where the mouse pointer was. (In reply to Andrey Loskutov from comment #1) > Just wondering about bug 431423, where the menu does NOT appears where the > mouse pointer was. Different issue: AFAICT in that case setLocation() isn't being called. Adding an upstream GNOME bug as it might help the situation on Wayland. New Gerrit change created: https://git.eclipse.org/r/118813 Gerrit change https://git.eclipse.org/r/118813 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9c6346c33b2ceab571983d3f58db7ceed75a22e8 New Gerrit change created: https://git.eclipse.org/r/119826 Gerrit change https://git.eclipse.org/r/119826 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=47598b7e6318e7cfae9c33fcf18610194b1c4741 (In reply to Eclipse Genie from comment #7) > Gerrit change https://git.eclipse.org/r/119826 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=47598b7e6318e7cfae9c33fcf18610194b1c4741 Fix is in master now. Verified in I20180507-2205. *** Bug 534841 has been marked as a duplicate of this bug. *** |
Created attachment 272379 [details] Snippet reproducing the issue This seems to be a general implementation issue in GTK. Using Menu.setLocation() is ineffectual as the menu always pops up where the mouse pointer is. Furthermore, Menu.setLocation() doesn't do anything. It sets some variables in Menu but those variables aren't ever accessed after being set. Attached is a snippet that reproduces the issue. Steps: 1) Launch the snippet, and click the "Open dialog" button. 2) A modal dialog will popup with a button in it. Click the button. 3) The menu pops up normally. Close it by hitting escape. Now the button has focus. 4) Move the mouse anywhere else on the screen and hit enter (to press the button). The menu will popup either at the pointer, or at incorrect coordinates all together. This happens on GTK2 and GTK3, X11 and Wayland. I don't think there is much we can do about it on GTK2 but GTK3.22 has API for this case: gtk_menu_popup_at_rect(). There is also API to have a menu be attached to a widget: gtk_menu_popup_at_widget(). This might be useful when Control.setMenu() is invoked.