Bug 289346: [Widgets] Gtk SWT should set type hint for floating shell
windows
Implement SWT.TOOL functionality in Shell by setting the appropriate
GdkWindowTypeHint.
Tested on GTK3.22 - no AllNonBrowser JUnit tests fail, child Eclipse
popups and shells look normal.
Change-Id: I82c9bd3bc5087d3eb445d28a2f893375e01e6ea8
Signed-off-by: Eric Williams <ericwill@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
index 15defef..0313ced 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java
@@ -246,6 +246,7 @@
public static final int GDK_WA_Y = 1 << 3;
public static final int GDK_WA_VISUAL = 1 << 6;
public static final int GDK_WINDOW_TYPE_HINT_DIALOG = 1;
+ public static final int GDK_WINDOW_TYPE_HINT_UTILITY = 5;
public static final int GDK_WINDOW_TYPE_HINT_TOOLTIP = 10;
/** sizeof(TYPE) for 32/64 bit support */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index 3143237..89119ce 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -754,6 +754,9 @@
GTK.gtk_widget_modify_bg (shellHandle, GTK.GTK_STATE_NORMAL, color);
}
}
+ if ((style & SWT.TOOL) != 0) {
+ GTK.gtk_window_set_type_hint(shellHandle, GDK.GDK_WINDOW_TYPE_HINT_UTILITY);
+ }
if ((style & SWT.NO_TRIM) != 0 ) {
GTK.gtk_window_set_decorated(shellHandle, false);
}