Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2018-03-20 21:04:02 +0000
committerEric Williams2018-03-22 15:40:33 +0000
commit47598b7e6318e7cfae9c33fcf18610194b1c4741 (patch)
tree7069c96e3221bf903a2abe476b3db5529bc98034 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
parentbaaa06d650c0cab6e9b17c558562bdffed23a299 (diff)
downloadeclipse.platform.swt-47598b7e6318e7cfae9c33fcf18610194b1c4741.tar.gz
eclipse.platform.swt-47598b7e6318e7cfae9c33fcf18610194b1c4741.tar.xz
eclipse.platform.swt-47598b7e6318e7cfae9c33fcf18610194b1c4741.zip
Bug 530204: [GTK] Menu appears at mouse regardless of setLocation()I20180322-2000
This patch contains two main parts. Part 1 - functionality implementation: This implements functionality for Menu.setLocation() to actually work as intended. Currently menus are popped up wherever the mouse pointer is, completely ignoring any coordinates given to setLocation(). The functionality provided by this patch only works on X11, as Wayland has no global coordinate system (this has been documented in the javadocs in an earlier patch). Part 2 - debugging support: Menu positioning issues are very hard to pin down, since they cannot be inspected with GtkInspector. Thankfully, GTK3.22+ has API support to remedy this. It's now possible to connect a GtkMenu to the "popped-up" signal. After a GtkMenu is popped up/shown, a callback is triggered. The parameters to the callback function contain information about the menu's position/size, straight from GTK's internal machinery. This patch adds an environment variable, SWT_MENU_LOCATION_DEBUGGING, which (when set) will enable SWT to make use of GTK's "popped-up" signal. The callback function in SWT will print certain information about the menu as provided from GTK. For more information on the "popped-up" signal, see: https://developer.gnome.org/gtk3/stable/GtkMenu.html#GtkMenu-popped-up Tested on Wayland and X11 with GTK3.22. GTK3.20- behaviour is unchanged, as it still uses the older GtkMenu API. No AllNonBrowser JUnit tests fail. IDE testing shows that menus now behave the same as on Win32 or Cocoa (best way to test this: give focus to the "Show In" button in the Open Resource Dialog, and trigger a button press with the keyboard while having the mouse elsewhere -> menu should open up by the button, not the mouse). Change-Id: Ia221734a774d6a18afc4ef879ff883ded7ed81ae Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index acb4dbf71f..f707a39a38 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -88,6 +88,7 @@ typedef enum {
_1gdk_1device_1warp_FUNC,
_1gdk_1display_1beep_FUNC,
_1gdk_1display_1get_1default_FUNC,
+ _1gdk_1display_1get_1default_1group_FUNC,
_1gdk_1display_1get_1default_1seat_FUNC,
_1gdk_1display_1get_1device_1manager_FUNC,
_1gdk_1display_1supports_1cursor_1color_FUNC,
@@ -636,6 +637,7 @@ typedef enum {
_1gtk_1menu_1popdown_FUNC,
_1gtk_1menu_1popup_FUNC,
_1gtk_1menu_1popup_1at_1pointer_FUNC,
+ _1gtk_1menu_1popup_1at_1rect_FUNC,
_1gtk_1menu_1shell_1deactivate_FUNC,
_1gtk_1menu_1shell_1insert_FUNC,
_1gtk_1menu_1shell_1set_1take_1focus_FUNC,

Back to the top