From 8b7955bfb1508973a14e1e71051f41fe811eaffa Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Tue, 4 Feb 2025 00:33:17 +0100 Subject: [PATCH] [GTK4] Stop handling expose events directly The handling of expose events has been internalized with GTK4 making it impossible to e.g. invalidate an area of a surface. Furthermore, the native method that are called no longer exist in GTK4, leading to an UnsatisfiedLinkError. From the documentation: Application and widget code should not handle expose events directly; invalidation should use the GtkWidget API, and drawing should only happen inside GtkWidget::draw implementations. Closes https://github.com/eclipse-platform/eclipse.platform.swt/issues/1794 --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index 8db2c598ade..c7a6cd88624 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -1015,6 +1015,9 @@ static void checkDisplay (Thread thread, boolean multiple) { } long checkIfEventProc (long display, long xEvent, long userData) { + if (GTK.GTK4) { + return 0; + } int type = OS.X_EVENT_TYPE (xEvent); switch (type) { case OS.Expose: