Skip to content

Commit 286e614

Browse files
committed
[GTK4] Let Display.post throw exceptions
While there is no Gtk 4 implementation, currently it's disabled as a very first thing thus no exception will be thrown even when display is disposed or event it null. Move the Gtk 4 check down to keep behavior with exceptions.
1 parent bcd5988 commit 286e614

File tree

1 file changed

+6
-5
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+6
-5
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,16 +4303,17 @@ long findFocusedWindow() {
43034303
* @since 3.0
43044304
*/
43054305
public boolean post (Event event) {
4306-
/*
4307-
* GdkEvents are now strictly read-only
4308-
* https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-gdkevent-api-changes
4309-
*/
4310-
if (GTK.GTK4) return false;
43114306

43124307
synchronized (Device.class) {
43134308
if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
43144309
if (event == null) error (SWT.ERROR_NULL_ARGUMENT);
43154310

4311+
/*
4312+
* GdkEvents are now strictly read-only
4313+
* https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-gdkevent-api-changes
4314+
*/
4315+
if (GTK.GTK4) return false;
4316+
43164317
int type = event.type;
43174318

43184319
if (type == SWT.MouseMove) {

0 commit comments

Comments
 (0)