From bd0a7fc3bb8e45c925d002aac12780bf57e7646f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Apr 29 2008 09:51:27 +0000 Subject: - Add patch from upstream to avoid the Stop button triggering an Eject (#346201) --- diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec index be0ef6a..66c7cd8 100644 --- a/gnome-settings-daemon.spec +++ b/gnome-settings-daemon.spec @@ -1,6 +1,6 @@ Name: gnome-settings-daemon Version: 2.22.1 -Release: 0.2008.03.26.7%{?dist} +Release: 1.2008.03.26.7%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications Group: System Environment/Daemons @@ -34,6 +34,9 @@ Patch2: gnome-settings-daemon-2.21.91-ignore-model-if-evdev.patch # http://bugzilla.gnome.org/show_bug.cgi?id=524499 Patch3: gsd-mouse-too-much-grab.patch Patch4: gnome-settings-daemon-2.22.1-hide-white-screen.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=530356 +# https://bugzilla.redhat.com/show_bug.cgi?id=346201 +Patch5: gsd-handle-different-keysyms.patch %description A daemon to share settings from GNOME to other applications. It also @@ -59,6 +62,7 @@ pushd plugins/mouse/ %patch3 -p0 -b .no-eat-keys popd %patch4 -p1 -b .hide-white-screen +%patch5 -p1 -b .multi-keysyms %build %configure --enable-static=no --enable-profiling @@ -140,6 +144,9 @@ fi %{_libdir}/pkgconfig/gnome-settings-daemon.pc %changelog +* Tue Apr 29 2008 - Bastien Nocera - 2.22.1-1.2008.03.26.7 +- Add patch from upstream to avoid the Stop button triggering an Eject (#346201) + * Fri Apr 25 2008 Soren Sandmann - 2.22.1-2008.03.26.7 - Integrate various fixes from other distributions. Remove xrandr-missingok patch. diff --git a/gsd-handle-different-keysyms.patch b/gsd-handle-different-keysyms.patch new file mode 100644 index 0000000..35383e0 --- /dev/null +++ b/gsd-handle-different-keysyms.patch @@ -0,0 +1,75 @@ +--- 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 + #include ++#ifdef HAVE_X11_EXTENSIONS_XKB_H ++#include ++#include ++#include ++#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));