Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java6
5 files changed, 19 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 0c5be840b5..8444a6dc7f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -10541,7 +10541,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1menu_1item_1remove_1submenu)
(JNIEnv *env, jclass that, jintLong arg0)
{
OS_NATIVE_ENTER(env, that, _1gtk_1menu_1item_1remove_1submenu_FUNC);
+/*
gtk_menu_item_remove_submenu((GtkMenuItem *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_menu_item_remove_submenu)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GtkMenuItem *))fp)((GtkMenuItem *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1menu_1item_1remove_1submenu_FUNC);
}
#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
index d965f3762f..d949a80cb3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
@@ -19,6 +19,7 @@
#define NDEBUG
#define G_DISABLE_DEPRECATED
+/*
#define GTK_DISABLE_DEPRECATED
/*
*/
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 46c6d25277..4172256436 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -122,6 +122,7 @@
#define gtk_icon_info_free_LIB LIB_GTK
#define gtk_icon_theme_lookup_by_gicon_LIB LIB_GTK
#define gtk_icon_theme_get_default_LIB LIB_GTK
+#define gtk_menu_item_remove_submenu_LIB LIB_GTK
#define gtk_menu_shell_set_take_focus_LIB LIB_GTK
#define gtk_window_set_keep_below_LIB LIB_GTK
#define gtk_toolbar_set_orientation_LIB LIB_GTK
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 12c1607739..b7f8bdf8de 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -8253,7 +8253,10 @@ public static final int /*long*/ gtk_menu_get_attach_widget(int /*long*/ menu) {
lock.unlock();
}
}
-/** @param menu_item cast=(GtkMenuItem *) */
+/**
+ * @method flags=dynamic
+ * @param menu_item cast=(GtkMenuItem *)
+ */
public static final native void _gtk_menu_item_remove_submenu(int /*long*/ menu_item);
public static final void gtk_menu_item_remove_submenu(int /*long*/ menu_item) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index d0a81f5582..8be098e77a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -772,7 +772,11 @@ public void setMenu (Menu menu) {
* to replace or GTK will destroy it.
*/
OS.g_object_ref (oldMenu.handle);
- OS.gtk_menu_item_remove_submenu (handle);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_menu_item_set_submenu (handle, 0);
+ } else {
+ OS.gtk_menu_item_remove_submenu (handle);
+ }
}
if ((this.menu = menu) != null) {
menu.cascade = this;

Back to the top