[gnome-desktop/jjardon/gdkx_guards: 10/10] gnome-idle-monitor.c: Add guards to X-only code
- From: Javier Jardón Cabezas <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/jjardon/gdkx_guards: 10/10] gnome-idle-monitor.c: Add guards to X-only code
- Date: Sat, 30 Nov 2019 17:09:46 +0000 (UTC)
commit 8c375bf21fdb58c6506c0100cca01a2d865a02ac
Author: Javier Jardón <jjardon gnome org>
Date: Sun Nov 24 19:47:16 2019 +0900
gnome-idle-monitor.c: Add guards to X-only code
libgnome-desktop/gnome-idle-monitor.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c
index d7583a2b..79de9d71 100644
--- a/libgnome-desktop/gnome-idle-monitor.c
+++ b/libgnome-desktop/gnome-idle-monitor.c
@@ -25,7 +25,9 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#endif
#include <gdk/gdk.h>
#if defined(GDK_WINDOWING_WAYLAND)
#include <gdk/gdkwayland.h>
@@ -208,8 +210,14 @@ gnome_idle_monitor_set_property (GObject *object,
g_free (monitor->priv->path);
if (monitor->priv->device) {
+#ifdef GDK_WINDOWING_X11
+ if(GDK_IS_X11_DISPLAY (gdk_display_get_default ())){
monitor->priv->path = g_strdup_printf ("/org/gnome/Mutter/IdleMonitor/Device%d",
gdk_x11_device_get_id (monitor->priv->device));
+#else
+ monitor->priv->path = g_strdup_printf ("/org/gnome/Mutter/IdleMonitor/Device%s",
+ gdk_device_get_product_id
(monitor->priv->device));
+#endif
} else {
monitor->priv->path = g_strdup ("/org/gnome/Mutter/IdleMonitor/Core");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]