Fix downstream synaptics patches breaking xdmcp

Resolves: #2092452
This commit is contained in:
Olivier Fourdan 2022-06-03 15:38:09 +02:00
parent 72bc220467
commit 82cf8fba33
2 changed files with 54 additions and 52 deletions

View File

@ -1,4 +1,4 @@
From 705818340dec181335b48ab73d6411e639daaeae Mon Sep 17 00:00:00 2001
From 22fe64732e11199901d4a35f9d3c63d5d6deb3a3 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 1 Jun 2021 11:44:20 +0200
Subject: [PATCH 1/6] backends/x11: Support synaptics configuration
@ -6,11 +6,11 @@ Subject: [PATCH 1/6] backends/x11: Support synaptics configuration
The code is taken mostly as-is from g-s-d, so we can drag the
dead horse a bit longer.
---
src/backends/x11/meta-input-settings-x11.c | 275 +++++++++++++++++++++
1 file changed, 275 insertions(+)
src/backends/x11/meta-input-settings-x11.c | 274 +++++++++++++++++++++
1 file changed, 274 insertions(+)
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 96390285a6..0631fd2fee 100644
index 371e2f60e..426056390 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -26,6 +26,7 @@
@ -21,7 +21,7 @@ index 96390285a6..0631fd2fee 100644
#include <string.h>
#include <X11/Xatom.h>
#include <X11/extensions/XInput2.h>
@@ -165,6 +166,184 @@ change_property (ClutterInputDevice *device,
@@ -165,6 +166,183 @@ change_property (ClutterInputDevice *device,
meta_XFree (data_ret);
}
@ -45,7 +45,6 @@ index 96390285a6..0631fd2fee 100644
+ gboolean left_handed)
+{
+ MetaDisplay *display = meta_get_display ();
+ MetaX11Display *x11_display = display ? display->x11_display : NULL;
+ MetaBackend *backend = meta_get_backend ();
+ Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+ int device_id;
@ -71,8 +70,7 @@ index 96390285a6..0631fd2fee 100644
+ XA_INTEGER, 8, tap_action, 7);
+ meta_XFree (tap_action);
+
+ if (x11_display)
+ meta_x11_error_trap_push (x11_display);
+ clutter_x11_trap_x_errors();
+ buttons = g_new (guchar, buttons_capacity);
+ n_buttons = XGetDeviceButtonMapping (xdisplay, xdevice,
+ buttons, buttons_capacity);
@ -92,7 +90,7 @@ index 96390285a6..0631fd2fee 100644
+ XSetDeviceButtonMapping (xdisplay, xdevice, buttons, n_buttons);
+ g_free (buttons);
+
+ if (x11_display && meta_x11_error_trap_pop_with_return (x11_display))
+ if (clutter_x11_untrap_x_errors())
+ {
+ g_warning ("Could not set synaptics touchpad left-handed for %s",
+ clutter_input_device_get_device_name (device));
@ -107,7 +105,6 @@ index 96390285a6..0631fd2fee 100644
+ gdouble speed)
+{
+ MetaDisplay *display = meta_get_display ();
+ MetaX11Display *x11_display = display ? display->x11_display : NULL;
+ MetaBackend *backend = meta_get_backend ();
+ Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+ int device_id;
@ -122,7 +119,10 @@ index 96390285a6..0631fd2fee 100644
+ if (!xdevice)
+ return;
+ /* Get the list of feedbacks for the device */
+ clutter_x11_trap_x_errors();
+ states = XGetFeedbackControl (xdisplay, xdevice, &num_feedbacks);
+ if (clutter_x11_untrap_x_errors())
+ return;
+ if (!states)
+ return;
+
@ -167,8 +167,7 @@ index 96390285a6..0631fd2fee 100644
+ denominator = -1;
+ }
+
+ if (x11_display)
+ meta_x11_error_trap_push (x11_display);
+ clutter_x11_trap_x_errors();
+
+ state = (XFeedbackState *) states;
+
@ -193,7 +192,7 @@ index 96390285a6..0631fd2fee 100644
+ state = (XFeedbackState *) ((char *) state + state->length);
+ }
+
+ if (x11_display && meta_x11_error_trap_pop_with_return (x11_display))
+ if (clutter_x11_untrap_x_errors())
+ {
+ g_warning ("Could not set synaptics touchpad acceleration for %s",
+ clutter_input_device_get_device_name (device));
@ -206,7 +205,7 @@ index 96390285a6..0631fd2fee 100644
static void
meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -173,6 +352,13 @@ meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
@@ -173,6 +351,13 @@ meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
guchar values[2] = { 0 }; /* disabled, disabled-on-external-mouse */
guchar *available;
@ -220,7 +219,7 @@ index 96390285a6..0631fd2fee 100644
available = get_property (device, "libinput Send Events Modes Available",
XA_INTEGER, 8, 2);
if (!available)
@@ -225,6 +411,12 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
@@ -225,6 +410,12 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
gfloat value = speed;
@ -233,7 +232,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Accel Speed",
XInternAtom (xdisplay, "FLOAT", False),
32, &value, 1);
@@ -251,6 +443,19 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
@@ -251,6 +442,19 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
else
{
value = enabled ? 1 : 0;
@ -253,7 +252,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Left Handed Enabled",
XA_INTEGER, 8, &value, 1);
}
@@ -274,6 +479,20 @@ meta_input_settings_x11_set_tap_enabled (MetaInputSettings *settings,
@@ -274,6 +478,20 @@ meta_input_settings_x11_set_tap_enabled (MetaInputSettings *settings,
{
guchar value = (enabled) ? 1 : 0;
@ -274,7 +273,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Tapping Enabled",
XA_INTEGER, 8, &value, 1);
}
@@ -307,6 +526,27 @@ meta_input_settings_x11_set_invert_scroll (MetaInputSettings *settings,
@@ -307,6 +525,27 @@ meta_input_settings_x11_set_invert_scroll (MetaInputSettings *settings,
{
guchar value = (inverted) ? 1 : 0;
@ -302,7 +301,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Natural Scrolling Enabled",
XA_INTEGER, 8, &value, 1);
}
@@ -320,6 +560,41 @@ change_scroll_method (ClutterInputDevice *device,
@@ -320,6 +559,41 @@ change_scroll_method (ClutterInputDevice *device,
guchar *current = NULL;
guchar *available = NULL;
@ -345,10 +344,10 @@ index 96390285a6..0631fd2fee 100644
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
if (!available || !available[method])
--
2.31.1
2.36.1
From 50c4733acf56b3b67a2706d32f5c455cb51f9458 Mon Sep 17 00:00:00 2001
From 963ff120898e7e42d80d5761753e76adcf16c132 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 13 Feb 2018 11:44:40 +0100
Subject: [PATCH 2/6] clutter: Extend touchpad device property check for
@ -361,7 +360,7 @@ to get the device type may fall short.
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index d43834bd7b..73938e22e0 100644
index d43834bd7..73938e22e 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -246,7 +246,8 @@ is_touch_device (XIAnyClassInfo **classes,
@ -403,10 +402,10 @@ index d43834bd7b..73938e22e0 100644
get_device_ids (XIDeviceInfo *info,
char **vendor_id,
--
2.31.1
2.36.1
From 307970305d11cdca1b97c53c85bda8b809ff4f0f Mon Sep 17 00:00:00 2001
From 86cc1b46dae01da619980af826eb9bf81cf31143 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Mon, 9 Oct 2017 18:39:52 +0200
Subject: [PATCH 3/6] backends/x11: Add a synaptics check for two finger scroll
@ -421,10 +420,10 @@ isn't.
1 file changed, 11 insertions(+)
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 0631fd2fee..2ac080127c 100644
index 426056390..db2b2a4fb 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -638,6 +638,17 @@ meta_input_settings_x11_has_two_finger_scroll (MetaInputSettings *settings,
@@ -637,6 +637,17 @@ meta_input_settings_x11_has_two_finger_scroll (MetaInputSettings *settings,
guchar *available = NULL;
gboolean has_two_finger = TRUE;
@ -443,10 +442,10 @@ index 0631fd2fee..2ac080127c 100644
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
if (!available || !available[SCROLL_METHOD_FIELD_2FG])
--
2.31.1
2.36.1
From cba31f88ddbfb7355de1daa34397aba8e8607765 Mon Sep 17 00:00:00 2001
From 32e2da07eeb1f9edcf03751285a756ab1acca6a8 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Mon, 9 Oct 2017 18:55:56 +0200
Subject: [PATCH 4/6] backends/x11: Add disable while typing support for
@ -459,7 +458,7 @@ syndaemon when the synaptics driver is being used.
1 file changed, 112 insertions(+)
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 2ac080127c..2658b82172 100644
index db2b2a4fb..bf9d769e9 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -35,6 +35,9 @@
@ -481,7 +480,7 @@ index 2ac080127c..2658b82172 100644
} MetaInputSettingsX11Private;
G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettingsX11, meta_input_settings_x11,
@@ -344,6 +349,107 @@ change_synaptics_speed (ClutterInputDevice *device,
@@ -343,6 +348,107 @@ change_synaptics_speed (ClutterInputDevice *device,
XCloseDevice (xdisplay, xdevice);
}
@ -589,7 +588,7 @@ index 2ac080127c..2658b82172 100644
static void
meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -468,6 +574,12 @@ meta_input_settings_x11_set_disable_while_typing (MetaInputSettings *settings,
@@ -467,6 +573,12 @@ meta_input_settings_x11_set_disable_while_typing (MetaInputSettings *settings,
{
guchar value = (enabled) ? 1 : 0;
@ -603,10 +602,10 @@ index 2ac080127c..2658b82172 100644
XA_INTEGER, 8, &value, 1);
}
--
2.31.1
2.36.1
From 354d34263534d0c7a5c7f7169d8b4a3dba79491c Mon Sep 17 00:00:00 2001
From 6da0bfe86f416d3cfc5cc6993e8e2f6ca255e85a Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 13 Jun 2018 13:48:24 +0200
Subject: [PATCH 5/6] clutter: Only reset scroll axes on slave devices
@ -617,7 +616,7 @@ As a plus, unknown source device IDs will just warn instead of crash.
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index 73938e22e0..6d2c7d3740 100644
index 73938e22e..6d2c7d374 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -2362,7 +2362,9 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
@ -632,10 +631,10 @@ index 73938e22e0..6d2c7d3740 100644
clutter_event_set_device (event, device);
clutter_event_set_source_device (event, source_device);
--
2.31.1
2.36.1
From b7f94b5dd09953d5a4c8aee1b79491d71f8c1e0e Mon Sep 17 00:00:00 2001
From da60cf38c7fcec68f8e79a8a3a174e551c07a64a Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Tue, 10 Oct 2017 19:07:27 +0200
Subject: [PATCH 6/6] backends/x11: Support plain old X device configuration
@ -647,10 +646,10 @@ bits specific for xorg-x11-drv-evdev devices.
1 file changed, 75 insertions(+), 23 deletions(-)
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 2658b82172..80bc33c6b5 100644
index bf9d769e9..49dcb74f1 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -185,10 +185,23 @@ is_device_synaptics (ClutterInputDevice *device)
@@ -185,17 +185,30 @@ is_device_synaptics (ClutterInputDevice *device)
return TRUE;
}
@ -676,8 +675,7 @@ index 2658b82172..80bc33c6b5 100644
+ gboolean left_handed)
{
MetaDisplay *display = meta_get_display ();
MetaX11Display *x11_display = display ? display->x11_display : NULL;
@@ -196,7 +209,7 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
MetaBackend *backend = meta_get_backend ();
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
int device_id;
XDevice *xdevice;
@ -686,7 +684,7 @@ index 2658b82172..80bc33c6b5 100644
guint buttons_capacity = 16, n_buttons;
device_id = meta_input_device_x11_get_device_id (device);
@@ -204,19 +217,6 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
@@ -203,19 +216,6 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
if (!xdevice)
return;
@ -703,12 +701,12 @@ index 2658b82172..80bc33c6b5 100644
- XA_INTEGER, 8, tap_action, 7);
- meta_XFree (tap_action);
-
if (x11_display)
meta_x11_error_trap_push (x11_display);
clutter_x11_trap_x_errors();
buttons = g_new (guchar, buttons_capacity);
@@ -240,17 +240,39 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
n_buttons = XGetDeviceButtonMapping (xdisplay, xdevice,
@@ -238,17 +238,39 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
if (x11_display && meta_x11_error_trap_pop_with_return (x11_display))
if (clutter_x11_untrap_x_errors())
{
- g_warning ("Could not set synaptics touchpad left-handed for %s",
+ g_warning ("Could not set left-handed for %s",
@ -749,8 +747,8 @@ index 2658b82172..80bc33c6b5 100644
+ gdouble speed)
{
MetaDisplay *display = meta_get_display ();
MetaX11Display *x11_display = display ? display->x11_display : NULL;
@@ -349,6 +371,23 @@ change_synaptics_speed (ClutterInputDevice *device,
MetaBackend *backend = meta_get_backend ();
@@ -348,6 +370,23 @@ change_synaptics_speed (ClutterInputDevice *device,
XCloseDevice (xdisplay, xdevice);
}
@ -774,7 +772,7 @@ index 2658b82172..80bc33c6b5 100644
/* Ensure that syndaemon dies together with us, to avoid running several of
* them */
static void
@@ -517,9 +556,10 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
@@ -516,9 +555,10 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
gfloat value = speed;
@ -787,7 +785,7 @@ index 2658b82172..80bc33c6b5 100644
return;
}
@@ -561,6 +601,11 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
@@ -560,6 +600,11 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
g_object_unref (settings);
return;
}
@ -799,7 +797,7 @@ index 2658b82172..80bc33c6b5 100644
change_property (device, "libinput Left Handed Enabled",
XA_INTEGER, 8, &value, 1);
@@ -778,7 +823,14 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings *settings,
@@ -777,7 +822,14 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings *settings,
{
gchar lock = button_lock;
@ -815,5 +813,5 @@ index 2658b82172..80bc33c6b5 100644
XA_CARDINAL, 32, &button, 1);
change_property (device, "libinput Button Scrolling Button Lock Enabled",
--
2.31.1
2.36.1

View File

@ -10,7 +10,7 @@
Name: mutter
Version: 40.9
Release: 10%{?dist}
Release: 11%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -251,6 +251,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Tue Dec 06 2022 Olivier Fourdan <ofourdan@redhat.com> - 40.9-11
- Fix downstream synaptics patches breaking xdmcp
Resolves: #2092452
* Thu Oct 20 2022 Jonas Ådahl <jadahl@redhat.com>) - 40.9-10
- Don't add common modes if panel already has
Resolves: #2125032