From 2c089490d32be01fe11e450704f3de57c19ecc26 Mon Sep 17 00:00:00 2001 From: sandmann Date: Sat, 9 Sep 2006 22:16:00 +0000 Subject: Add patch that may fix bug 204519 --- metacity-2.16.0-losing-focus.patch | 152 +++++++++++++++++++++++++++++++++++++ metacity.spec | 7 +- 2 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 metacity-2.16.0-losing-focus.patch diff --git a/metacity-2.16.0-losing-focus.patch b/metacity-2.16.0-losing-focus.patch new file mode 100644 index 0000000..6c6a28c --- /dev/null +++ b/metacity-2.16.0-losing-focus.patch @@ -0,0 +1,152 @@ +Index: src/display.c +=================================================================== +RCS file: /cvs/gnome/metacity/src/display.c,v +retrieving revision 1.288 +diff -p -u -r1.288 display.c +--- src/display.c 21 Aug 2006 18:38:21 -0000 1.288 ++++ src/display.c 9 Sep 2006 18:55:33 -0000 +@@ -3323,7 +3323,7 @@ meta_display_begin_grab_op (MetaDisplay + + else + display->grab_have_keyboard = +- meta_screen_grab_all_keys (screen); ++ meta_screen_grab_all_keys (screen, timestamp); + + if (!display->grab_have_keyboard) + { +@@ -3618,9 +3618,9 @@ meta_display_end_grab_op (MetaDisplay *d + meta_topic (META_DEBUG_WINDOW_OPS, + "Ungrabbing all keys timestamp %lu\n", timestamp); + if (display->grab_window) +- meta_window_ungrab_all_keys (display->grab_window); ++ meta_window_ungrab_all_keys (display->grab_window, timestamp); + else +- meta_screen_ungrab_all_keys (display->grab_screen); ++ meta_screen_ungrab_all_keys (display->grab_screen, timestamp); + } + + #ifdef HAVE_XSYNC +Index: src/keybindings.c +=================================================================== +RCS file: /cvs/gnome/metacity/src/keybindings.c,v +retrieving revision 1.132 +diff -p -u -r1.132 keybindings.c +--- src/keybindings.c 21 Aug 2006 19:06:25 -0000 1.132 ++++ src/keybindings.c 9 Sep 2006 18:55:33 -0000 +@@ -1208,18 +1208,17 @@ grab_status_to_string (int status) + + static gboolean + grab_keyboard (MetaDisplay *display, +- Window xwindow) ++ Window xwindow, ++ Time timestamp) + { + int result; + int grab_status; +- Time timestamp; + + /* Grab the keyboard, so we get key releases and all key + * presses + */ + meta_error_trap_push_with_return (display); + +- timestamp = meta_display_get_current_time (display); + grab_status = XGrabKeyboard (display->xdisplay, + xwindow, True, + GrabModeAsync, GrabModeAsync, +@@ -1251,12 +1250,8 @@ grab_keyboard (MetaDisplay *display, + } + + static void +-ungrab_keyboard (MetaDisplay *display) ++ungrab_keyboard (MetaDisplay *display, Time timestamp) + { +- Time timestamp; +- +- timestamp = meta_display_get_current_time (display); +- + meta_error_trap_push (display); + + meta_topic (META_DEBUG_KEYBINDINGS, +@@ -1267,7 +1262,7 @@ ungrab_keyboard (MetaDisplay *display) + } + + gboolean +-meta_screen_grab_all_keys (MetaScreen *screen) ++meta_screen_grab_all_keys (MetaScreen *screen, Time timestamp) + { + gboolean retval; + +@@ -1279,7 +1274,7 @@ meta_screen_grab_all_keys (MetaScreen *s + + meta_topic (META_DEBUG_KEYBINDINGS, + "Grabbing all keys on RootWindow\n"); +- retval = grab_keyboard (screen->display, screen->xroot); ++ retval = grab_keyboard (screen->display, screen->xroot, timestamp); + if (retval) + screen->all_keys_grabbed = TRUE; + else +@@ -1289,11 +1284,11 @@ meta_screen_grab_all_keys (MetaScreen *s + } + + void +-meta_screen_ungrab_all_keys (MetaScreen *screen) ++meta_screen_ungrab_all_keys (MetaScreen *screen, Time timestamp) + { + if (screen->all_keys_grabbed) + { +- ungrab_keyboard (screen->display); ++ ungrab_keyboard (screen->display, timestamp); + + screen->all_keys_grabbed = FALSE; + screen->keys_grabbed = FALSE; +@@ -1328,7 +1323,7 @@ meta_window_grab_all_keys (MetaWindow * + + meta_topic (META_DEBUG_KEYBINDINGS, + "Grabbing all keys on window %s\n", window->desc); +- retval = grab_keyboard (window->display, grabwindow); ++ retval = grab_keyboard (window->display, grabwindow, timestamp); + if (retval) + { + window->keys_grabbed = FALSE; +@@ -1340,11 +1335,11 @@ meta_window_grab_all_keys (MetaWindow * + } + + void +-meta_window_ungrab_all_keys (MetaWindow *window) ++meta_window_ungrab_all_keys (MetaWindow *window, Time timestamp) + { + if (window->all_keys_grabbed) + { +- ungrab_keyboard (window->display); ++ ungrab_keyboard (window->display, timestamp); + + window->grab_on_frame = FALSE; + window->all_keys_grabbed = FALSE; +Index: src/keybindings.h +=================================================================== +RCS file: /cvs/gnome/metacity/src/keybindings.h,v +retrieving revision 1.8 +diff -p -u -r1.8 keybindings.h +--- src/keybindings.h 21 Aug 2006 18:38:21 -0000 1.8 ++++ src/keybindings.h 9 Sep 2006 18:55:33 -0000 +@@ -29,13 +29,16 @@ void meta_display_init_keys + void meta_display_shutdown_keys (MetaDisplay *display); + void meta_screen_grab_keys (MetaScreen *screen); + void meta_screen_ungrab_keys (MetaScreen *screen); +-gboolean meta_screen_grab_all_keys (MetaScreen *screen); +-void meta_screen_ungrab_all_keys (MetaScreen *screen); ++gboolean meta_screen_grab_all_keys (MetaScreen *screen, ++ Time timestamp); ++void meta_screen_ungrab_all_keys (MetaScreen *screen, ++ Time timestamp); + void meta_window_grab_keys (MetaWindow *window); + void meta_window_ungrab_keys (MetaWindow *window); + gboolean meta_window_grab_all_keys (MetaWindow *window, + Time timestamp); +-void meta_window_ungrab_all_keys (MetaWindow *window); ++void meta_window_ungrab_all_keys (MetaWindow *window, ++ Time timestamp); + void meta_display_process_key_event (MetaDisplay *display, + MetaWindow *window, + XEvent *event); diff --git a/metacity.spec b/metacity.spec index 75980b3..a14079e 100644 --- a/metacity.spec +++ b/metacity.spec @@ -7,7 +7,7 @@ Summary: Metacity window manager Name: metacity Version: %{metacity_version} -Release: 1%{?dist} +Release: 2%{?dist} URL: http://ftp.gnome.org/pub/gnome/sources/metacity/ Source0: %{metacity_filename}.tar.bz2 License: GPL @@ -32,6 +32,7 @@ Requires: pkgconfig Patch0: metacity-2.4.13.90-ctrlaltdel.patch Patch1: metacity-2.13.89.0.2006.02.16-static-cm.patch +Patch2: metacity-2.16.0-losing-focus.patch %description @@ -43,6 +44,7 @@ GNOME 2. %patch0 -p1 -b .ctrlaltdel %patch1 -p1 -b .static-cm +%patch2 -p0 -b .losing-focus %build rm -rf $RPM_BUILD_ROOT @@ -118,6 +120,9 @@ fi %{_mandir}/man1/* %changelog +* Sat sep 9 2006 Soren Sandmann - 2.16.0-2.fc6 +- Add patch from Elijah that may fix bug 204519 + * Mon Sep 4 2006 Matthias Clasen - 2.16.0-1.fc6 - Update to 2.16.0 -- cgit