rpms/gnome-settings-daemon/devel gsd-handle-different-keysyms.patch, NONE, 1.1 gnome-settings-daemon.spec, 1.25, 1.26

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Tue Apr 29 10:04:30 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/gnome-settings-daemon/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5642

Modified Files:
	gnome-settings-daemon.spec 
Added Files:
	gsd-handle-different-keysyms.patch 
Log Message:
* Tue Apr 29 2008 - Bastien Nocera <bnocera at redhat.com> - 2.22.1.1-2
- Add patch from upstream to avoid the Stop button triggering an Eject (#346201)


gsd-handle-different-keysyms.patch:

--- NEW FILE gsd-handle-different-keysyms.patch ---
--- trunk/plugins/common/gsd-keygrab.c	2008/04/13 10:40:01	306
+++ trunk/plugins/common/gsd-keygrab.c	2008/04/29 08:41:52	326
@@ -24,6 +24,11 @@
 
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+#include <X11/XKBlib.h>
+#include <X11/extensions/XKB.h>
+#include <gdk/gdkkeysyms.h>
+#endif
 
 #include "gsd-keygrab.h"
 
@@ -119,9 +124,60 @@
         }
 }
 
+static gboolean
+have_xkb (Display *dpy)
+{
+	static int have_xkb = -1;
+
+	if (have_xkb == -1) {
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+		int opcode, error_base, major, minor, xkb_event_base;
+
+		gdk_error_trap_push ();
+		have_xkb = XkbQueryExtension (dpy,
+					      &opcode,
+					      &xkb_event_base,
+					      &error_base,
+					      &major,
+					      &minor)
+			&& XkbUseExtension (dpy, &major, &minor);
+		gdk_error_trap_pop ();
+#else
+		have_xkb = 0;
+#endif
+	}
+
+	return have_xkb;
+}
+
 gboolean
 match_key (Key *key, XEvent *event)
 {
+	GdkKeymap *keymap;
+	guint keyval;
+	GdkModifierType consumed;
+	gint group;
+
+	if (key == NULL)
+		return FALSE;
+
+	keymap = gdk_keymap_get_default ();
+	if (have_xkb (event->xkey.display))
+		group = XkbGroupForCoreState (event->xkey.state);
+	else
+		group = (event->xkey.state & GDK_Mode_switch) ? 1 : 0;
+	/* Check if we find a keysym that matches our current state */
+	if (gdk_keymap_translate_keyboard_state (keymap, event->xkey.keycode,
+					     event->xkey.state, group,
+					     &keyval, NULL, NULL, &consumed)) {
+		guint lower, upper;
+
+		gdk_keyval_convert_case (keyval, &lower, &upper);
+		return ((lower == key->keysym || upper == key->keysym)
+			&& (key->state & ~consumed & GSD_USED_MODS) == key->state);
+	}
+
+	/* The key we passed doesn't have a keysym, so try with just the keycode */
         return (key != NULL
                 && key->keycode == event->xkey.keycode
                 && key->state == (event->xkey.state & GSD_USED_MODS));


Index: gnome-settings-daemon.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-settings-daemon/devel/gnome-settings-daemon.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- gnome-settings-daemon.spec	26 Apr 2008 22:57:00 -0000	1.25
+++ gnome-settings-daemon.spec	29 Apr 2008 10:03:53 -0000	1.26
@@ -1,6 +1,6 @@
 Name:		gnome-settings-daemon
 Version:	2.23.1.1
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	The daemon sharing settings from GNOME to GTK+/KDE applications
 
 Group:		System Environment/Daemons
@@ -36,6 +36,9 @@
 Patch4:         gnome-settings-daemon-2.22.1-hide-white-screen.patch
 # survive xrandr being absent (such as on Xnest in sabayon)
 Patch5:		xrandr-missingok.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=530356
+# https://bugzilla.redhat.com/show_bug.cgi?id=346201
+Patch6:         gsd-handle-different-keysyms.patch
 
 %description
 A daemon to share settings from GNOME to other applications. It also
@@ -62,6 +65,7 @@
 popd
 %patch4 -p1 -b .hide-white-screen
 %patch5 -p1 -b .xrandr-missingok
+%patch6 -p1 -b .multi-keysyms
 
 %build
 %configure --enable-static=no --enable-profiling
@@ -144,6 +148,9 @@
 %{_libdir}/pkgconfig/gnome-settings-daemon.pc
 
 %changelog
+* Tue Apr 29 2008 - Bastien Nocera <bnocera at redhat.com> - 2.22.1.1-2
+- Add patch from upstream to avoid the Stop button triggering an Eject (#346201)
+
 * Fri Apr 25 2008 Matthias Clasen <mclasen at redhat.com> - 2.23.1.1-1
 - Update to 2.23.1.1
 




More information about the fedora-extras-commits mailing list