summaryrefslogtreecommitdiff
path: root/plugins/mouse
diff options
context:
space:
mode:
authorSunderland93 <[email protected]>2026-08-01 11:17:58 +0400
committerLuke from DC <[email protected]>2026-08-19 19:15:44 +0000
commit537e98c4ca8dc78f25d796af12f7f3a25b070e9b (patch)
treec55a8fc7ed9ce3f8178ce50eb4a16f2a4c16ce85 /plugins/mouse
parent7a53cc78e1418f37593055fa8c7a1ce0cbd5643f (diff)
downloadmate-settings-daemon-537e98c4ca8dc78f25d796af12f7f3a25b070e9b.tar.bz2
mate-settings-daemon-537e98c4ca8dc78f25d796af12f7f3a25b070e9b.tar.xz
Initial Wayland support
Diffstat (limited to 'plugins/mouse')
-rw-r--r--plugins/mouse/mouse.mate-settings-plugin.desktop.in1
-rw-r--r--plugins/mouse/msd-mouse-manager.c21
2 files changed, 22 insertions, 0 deletions
diff --git a/plugins/mouse/mouse.mate-settings-plugin.desktop.in b/plugins/mouse/mouse.mate-settings-plugin.desktop.in
index ae66d36..8b688f5 100644
--- a/plugins/mouse/mouse.mate-settings-plugin.desktop.in
+++ b/plugins/mouse/mouse.mate-settings-plugin.desktop.in
@@ -1,6 +1,7 @@
[MATE Settings Plugin]
Module=mouse
IAge=0
+X11Only=true
Name=Mouse
Description=Mouse plugin
Authors=
diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c
index 92a5f0a..fb4c35c 100644
--- a/plugins/mouse/msd-mouse-manager.c
+++ b/plugins/mouse/msd-mouse-manager.c
@@ -36,7 +36,9 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#endif /* GDK_WINDOWING_X11 */
#include <gdk/gdkkeysyms.h>
#include <X11/keysym.h>
#include <X11/Xatom.h>
@@ -1795,6 +1797,20 @@ msd_mouse_manager_start (MsdMouseManager *manager,
{
mate_settings_profile_start (NULL);
+#ifdef GDK_WINDOWING_X11
+ if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ())) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "X11 display is required for the mouse plugin");
+ mate_settings_profile_end (NULL);
+ return FALSE;
+ }
+#else
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "The mouse plugin was built without X11 support");
+ mate_settings_profile_end (NULL);
+ return FALSE;
+#endif /* GDK_WINDOWING_X11 */
+
if (!supports_xinput_devices ()) {
g_debug ("XInput is not supported, not applying any settings");
return TRUE;
@@ -1814,6 +1830,11 @@ msd_mouse_manager_stop (MsdMouseManager *manager)
g_debug ("Stopping mouse manager");
+#ifdef GDK_WINDOWING_X11
+ if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
+ return;
+#endif /* GDK_WINDOWING_X11 */
+
if (p->settings_mouse != NULL) {
g_object_unref(p->settings_mouse);
p->settings_mouse = NULL;