- left-handed-single-button.patch: Don't allow left-handed setting for
single-button touchpads. (related #548978)
This commit is contained in:
parent
ace48e720e
commit
d2db40a79f
@ -1,6 +1,6 @@
|
||||
Name: gnome-settings-daemon
|
||||
Version: 2.28.1
|
||||
Release: 11%{?dist}
|
||||
Release: 12%{?dist}
|
||||
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
|
||||
|
||||
Group: System Environment/Daemons
|
||||
@ -53,6 +53,10 @@ Patch8: survive-xmm.patch
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=604918
|
||||
Patch9: osd-spam.patch
|
||||
|
||||
# related 548978
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=606794
|
||||
Patch10: left-handed-single-button.patch
|
||||
|
||||
%description
|
||||
A daemon to share settings from GNOME to other applications. It also
|
||||
handles global keybindings, as well as a number of desktop-wide settings.
|
||||
@ -80,6 +84,7 @@ developing applications that use %{name}.
|
||||
%patch7 -p1 -b .iconleak
|
||||
%patch8 -p1 -b .survive-xmm
|
||||
%patch9 -p1 -b .osd-spam
|
||||
%patch10 -p1 -b .single-button
|
||||
|
||||
%build
|
||||
%configure --enable-static=no --enable-profiling --disable-esd
|
||||
@ -191,6 +196,10 @@ fi
|
||||
%{_libdir}/pkgconfig/gnome-settings-daemon.pc
|
||||
|
||||
%changelog
|
||||
* Mon Jan 18 2010 Peter Hutterer <peter.hutterer@redhat.com> 2.28.1-12
|
||||
- left-handed-single-button.patch: Don't allow left-handed setting for
|
||||
single-button touchpads. (related #548978)
|
||||
|
||||
* Wed Jan 13 2010 Peter Hutterer <peter.hutterer@redhat.com> 2.28.1-11
|
||||
- Plug memory leak in left-handed-touchpad.patch
|
||||
|
||||
|
71
left-handed-single-button.patch
Normal file
71
left-handed-single-button.patch
Normal file
@ -0,0 +1,71 @@
|
||||
From 4687c5f8033ae41868f3d4507bf21d66e0916835 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Wed, 13 Jan 2010 10:48:30 +1000
|
||||
Subject: [PATCH] Don't allow left-handed setting for single-button touchpads.
|
||||
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
plugins/mouse/gsd-mouse-manager.c | 36 +++++++++++++++++++++++++++++++++++-
|
||||
1 files changed, 35 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
|
||||
index bc83a0f..ecccd7c 100644
|
||||
--- a/plugins/mouse/gsd-mouse-manager.c
|
||||
+++ b/plugins/mouse/gsd-mouse-manager.c
|
||||
@@ -261,6 +261,36 @@ xinput_device_has_buttons (XDeviceInfo *device_info)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+static gboolean
|
||||
+touchpad_has_single_button(XDevice *device)
|
||||
+{
|
||||
+ Atom type, prop;
|
||||
+ int format;
|
||||
+ unsigned long nitems, bytes_after;
|
||||
+ unsigned char *data;
|
||||
+ gboolean is_single_button = FALSE;
|
||||
+ int rc;
|
||||
+
|
||||
+ prop = XInternAtom (GDK_DISPLAY (), "Synaptics Capabilities", False);
|
||||
+ if (!prop)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ gdk_error_trap_push ();
|
||||
+ rc = XGetDeviceProperty (GDK_DISPLAY (), device, prop, 0, 1, False,
|
||||
+ XA_INTEGER, &type, &format, &nitems,
|
||||
+ &bytes_after, &data);
|
||||
+ if (rc == Success && type == XA_INTEGER && format == 8 && nitems >= 3)
|
||||
+ is_single_button = (data[0] == 1 && data[1] == 0 && data[2] == 0);
|
||||
+
|
||||
+ if (rc == Success)
|
||||
+ XFree (data);
|
||||
+
|
||||
+ gdk_error_trap_pop ();
|
||||
+
|
||||
+ return is_single_button;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void
|
||||
set_xinput_devices_left_handed (gboolean left_handed)
|
||||
{
|
||||
@@ -292,11 +322,15 @@ set_xinput_devices_left_handed (gboolean left_handed)
|
||||
if (device != NULL) {
|
||||
GConfClient *client = gconf_client_get_default ();
|
||||
gboolean tap = gconf_client_get_bool (client, KEY_TAP_TO_CLICK, NULL);
|
||||
+ gboolean single_button = touchpad_has_single_button (device);
|
||||
|
||||
- if (tap)
|
||||
+ if (tap && !single_button)
|
||||
set_tap_to_click (tap, left_handed);
|
||||
XCloseDevice (GDK_DISPLAY (), device);
|
||||
g_object_unref (client);
|
||||
+
|
||||
+ if (single_button)
|
||||
+ continue;
|
||||
}
|
||||
|
||||
gdk_error_trap_push ();
|
||||
--
|
||||
1.6.6
|
||||
|
Loading…
Reference in New Issue
Block a user