Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul D'Pong2021-05-06 19:05:51 +0000
committerAlexander Kurtakov2021-05-11 18:37:29 +0000
commite4230bff3814b53828f5daa3b6442437e9f00fa4 (patch)
tree5ff6ba7a9b5852cedbf4bc98a7b6b947f5c8eeb8
parent43288ba74a837591608b5e2ad806a87603682d7e (diff)
downloadeclipse.platform.swt-e4230bff3814b53828f5daa3b6442437e9f00fa4.tar.gz
eclipse.platform.swt-e4230bff3814b53828f5daa3b6442437e9f00fa4.tar.xz
eclipse.platform.swt-e4230bff3814b53828f5daa3b6442437e9f00fa4.zip
Bug 573413 - [GTK4] Eclipse IDE fix errors due to GTK3 only functions
- setBackgroundSurface, remove function calls before version check - !GTK.GTK4 guard for gtk_widget_get_window call Change-Id: Ibd3fe33b0f11284935424430c6281eb63615d051 Signed-off-by: Paul D'Pong <sdamrong@redhat.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180327 Tested-by: Platform Bot <platform-bot@eclipse.org> Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 44717e7df1..e4bb0ad44c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -5192,11 +5192,12 @@ public void setBackgroundImage (Image image) {
}
void setBackgroundSurface (Image image) {
- long window = GTK3.gtk_widget_get_window (paintHandle ());
if (GTK.GTK_VERSION >= OS.VERSION(3, 22, 0)) {
// gdk_window_set_background_pattern() deprecated in GTK3.22+
return;
}
+
+ long window = GTK3.gtk_widget_get_window (paintHandle ());
if (window != 0) {
if (image.surface != 0) {
long pattern = Cairo.cairo_pattern_create_for_surface(image.surface);
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 36e226bb65..66828dff26 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
@@ -2934,7 +2934,7 @@ public void setVisible (boolean visible) {
mapped = true;
if ((style & mask) != 0) {
- gdk_pointer_ungrab (GTK3.gtk_widget_get_window (shellHandle), GDK.GDK_CURRENT_TIME);
+ if (!GTK.GTK4) gdk_pointer_ungrab (GTK3.gtk_widget_get_window (shellHandle), GDK.GDK_CURRENT_TIME);
}
opened = true;
if (!moved) {

Back to the top