Make libx11 optional, guard x11 code paths

It's not clear whether libwnck-based functionality will ever have a
counterpart on Wayland, so it seems pointless to replace libwnck with
libxfce4windowing at this stage.

Completes: ecd1e1a645
Related: #75, #78
This commit is contained in:
Gaël Bonithon
2023-09-05 17:01:23 +02:00
parent 0a155096e5
commit 30185130f2
7 changed files with 34 additions and 17 deletions

View File

@@ -15,6 +15,7 @@
#include <unistd.h>
#endif
#ifdef HAVE_LIBX11
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -22,9 +23,10 @@
#include <X11/Xmu/WinUtil.h>
#include <X11/cursorfont.h>
#include <X11/Xproto.h>
#include <gdk/gdkx.h>
#endif
#include <glib-object.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@@ -91,6 +93,7 @@ filter_entry_icon_pressed_cb (GtkEntry *entry,
}
}
#ifdef HAVE_LIBX11
static Window
Select_Window (Display *dpy, int screen)
{
@@ -181,6 +184,7 @@ xwininfo_clicked_cb (GtkButton *button __unused, gpointer user_data) {
}
}
#endif
static void
filter_entry_keyrelease_handler(GtkEntry *entry,
@@ -304,12 +308,13 @@ xtm_process_window_init (XtmProcessWindow *window)
G_CALLBACK (show_settings_dialog), window);
button = GTK_WIDGET (gtk_builder_get_object (window->builder, "button-identify"));
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
#ifdef HAVE_LIBX11
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (xwininfo_clicked_cb), window);
} else {
else
#endif
gtk_widget_hide (button);
}
window->filter_searchbar = GTK_WIDGET (gtk_builder_get_object (window->builder, "filter-searchbar"));
{