mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
Avoid a stuck grab, preventing focus from being transferred between
2006-09-09 Elijah Newren <newren gmail com> Avoid a stuck grab, preventing focus from being transferred between windows. Thanks to Fryderyk Dziarmagowski for steps to reproduce. Fixes at least part of #354422. * src/display.c (meta_display_begin_grab_op, meta_display_end_grab_op): pass timestamp to meta_screen_ungrab_all_keys, meta_screen_ungrab_all_keys, and meta_window_ungrab_all_keys * src/keybindings.[ch] (grab_keyboard, ungrab_keyboard): add a timestamp parameter and remove call to meta_display_get_current_time(), (meta_screen_grab_all_keys, meta_screen_ungrab_all_keys, meta_window_ungrab_all_keys): add a timestamp parameter and pass it on to grab_keyboard and ungrab_keyboard
This commit is contained in:
parent
2ab4a35c53
commit
555d7dc90c
18
ChangeLog
18
ChangeLog
@ -1,3 +1,21 @@
|
||||
2006-09-09 Elijah Newren <newren gmail com>
|
||||
|
||||
Avoid a stuck grab, preventing focus from being transferred
|
||||
between windows. Thanks to Fryderyk Dziarmagowski for steps to
|
||||
reproduce. Fixes at least part of #354422.
|
||||
|
||||
* src/display.c (meta_display_begin_grab_op,
|
||||
meta_display_end_grab_op): pass timestamp to
|
||||
meta_screen_ungrab_all_keys, meta_screen_ungrab_all_keys, and
|
||||
meta_window_ungrab_all_keys
|
||||
|
||||
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard): add a
|
||||
timestamp parameter and remove call to
|
||||
meta_display_get_current_time(), (meta_screen_grab_all_keys,
|
||||
meta_screen_ungrab_all_keys, meta_window_ungrab_all_keys): add a
|
||||
timestamp parameter and pass it on to grab_keyboard and
|
||||
ungrab_keyboard
|
||||
|
||||
2006-09-07 Elijah Newren <newren gmail com>
|
||||
|
||||
* src/constraints.c (update_onscreen_requirements): make sure
|
||||
|
@ -3323,7 +3323,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
|
||||
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 *display,
|
||||
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
|
||||
|
@ -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 *screen)
|
||||
|
||||
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 *screen)
|
||||
}
|
||||
|
||||
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 *window,
|
||||
|
||||
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 *window,
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -29,13 +29,16 @@ void meta_display_init_keys (MetaDisplay *display);
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user