Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ JNIEXPORT jlong JNICALL GDK_NATIVE(GDK_1EVENT_1WINDOW)
}
#endif

#ifndef NO_GDK_1IS_1WAYLAND_1DISPLAY
JNIEXPORT jboolean JNICALL GDK_NATIVE(GDK_1IS_1WAYLAND_1DISPLAY)
(JNIEnv *env, jclass that, jlong arg0)
{
jboolean rc = 0;
GDK_NATIVE_ENTER(env, that, GDK_1IS_1WAYLAND_1DISPLAY_FUNC);
rc = (jboolean)GDK_IS_WAYLAND_DISPLAY((GdkDisplay *)arg0);
GDK_NATIVE_EXIT(env, that, GDK_1IS_1WAYLAND_1DISPLAY_FUNC);
return rc;
}
#endif

#ifndef NO_GDK_1IS_1X11_1DISPLAY
JNIEXPORT jboolean JNICALL GDK_NATIVE(GDK_1IS_1X11_1DISPLAY)
(JNIEnv *env, jclass that, jlong arg0)
Expand Down
2 changes: 2 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@
#endif
#if !GTK_CHECK_VERSION(4,0,0)
#include <gdk/gdkx.h>
#include <gdk/gdkwayland.h>
#else
#include <gdk/x11/gdkx.h>
#include <gdk/wayland/gdkwayland.h>
#endif
#else

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
typedef enum {
GDK_1EVENT_1TYPE_FUNC,
GDK_1EVENT_1WINDOW_FUNC,
GDK_1IS_1WAYLAND_1DISPLAY_FUNC,
GDK_1IS_1X11_1DISPLAY_FUNC,
GDK_1TYPE_1PIXBUF_FUNC,
GDK_1TYPE_1RGBA_FUNC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ public class GDK extends OS {
/** @param event cast=(GdkEventAny *) */
public static final native long GDK_EVENT_WINDOW(long event);
/** @param display cast=(GdkDisplay *) */
public static final native boolean GDK_IS_WAYLAND_DISPLAY(long display);
/** @param display cast=(GdkDisplay *) */
public static final native boolean GDK_IS_X11_DISPLAY(long display);
/** @method flags=const */
public static final native long GDK_TYPE_RGBA();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ public static int VERSION(int major, int minor, int micro) {
}

public static boolean isWayland () {
return !isX11 ();
return OS.GDK_WINDOWING_WAYLAND() && GDK.GDK_IS_WAYLAND_DISPLAY(GDK.gdk_display_get_default());
}

public static boolean isX11 () {
Expand Down
Loading