Skip to content

Commit

Permalink
Make wayland dependency optional (#3347)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkyBluefang authored Feb 5, 2024
1 parent 7be3fbf commit 3fc6c6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion eel/eel-gtk-extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
#include <X11/Xatom.h>
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
#endif
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <math.h>
Expand Down Expand Up @@ -253,14 +255,15 @@ gboolean
eel_check_is_wayland (void)
{
static gboolean using_wayland = FALSE;
#ifdef GDK_WINDOWING_WAYLAND
static gsize once_init = 0;

if (g_once_init_enter (&once_init)) {
using_wayland = GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ());

g_once_init_leave (&once_init, 1);
}

#endif
return using_wayland;
}

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ glib_version = '>=2.45.7'
math = cc.find_library('m', required: true)

gtk = dependency('gtk+-3.0', version: '>=3.10.0')
gtk_wl = dependency('gtk+-wayland-3.0', version: '>=3.10.0')
gio = dependency('gio-2.0', version: glib_version)
gio_unix= dependency('gio-unix-2.0', version: glib_version)
glib = dependency('glib-2.0', version: glib_version)
Expand Down Expand Up @@ -203,6 +202,7 @@ message('\n'.join(['',
' libexif support: @0@'.format(libexif_enabled),
' exempi support: @0@'.format(exempi_enabled),
' Tracker support: @0@'.format(tracker_enabled),
' Wayland support: @0@'.format(cc.has_header('gdk/gdkwayland.h', dependencies: gtk)),
'',
' nemo-extension documentation: @0@'.format(gtkdoc_enabled),
' nemo-extension introspection: @0@'.format(true),
Expand Down

0 comments on commit 3fc6c6e

Please sign in to comment.