diff --git a/src/core/keybindings-private.h b/src/core/keybindings-private.h index 15c1700bd..5a39cd56d 100644 --- a/src/core/keybindings-private.h +++ b/src/core/keybindings-private.h @@ -94,10 +94,6 @@ 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, - guint32 timestamp); -void meta_screen_ungrab_all_keys (MetaScreen *screen, - guint32 timestamp); void meta_window_grab_keys (MetaWindow *window); void meta_window_ungrab_keys (MetaWindow *window); gboolean meta_window_grab_all_keys (MetaWindow *window, diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 4b9e9b5ea..f0b6122a1 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1159,9 +1159,6 @@ meta_screen_grab_keys (MetaScreen *screen) if (!META_IS_BACKEND_X11 (backend)) return; - if (screen->all_keys_grabbed) - return; - if (screen->keys_grabbed) return; @@ -1406,51 +1403,6 @@ ungrab_keyboard (MetaDisplay *display, guint32 timestamp) XIUngrabDevice (xdisplay, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp); } -gboolean -meta_screen_grab_all_keys (MetaScreen *screen, guint32 timestamp) -{ - gboolean retval; - MetaBackend *backend = meta_get_backend (); - - if (!META_IS_BACKEND_X11 (backend)) - return TRUE; - - if (screen->all_keys_grabbed) - return FALSE; - - if (screen->keys_grabbed) - meta_screen_ungrab_keys (screen); - - meta_topic (META_DEBUG_KEYBINDINGS, - "Grabbing all keys on RootWindow\n"); - retval = grab_keyboard (screen->display, screen->xroot, timestamp, XIGrabModeAsync); - if (retval) - { - screen->all_keys_grabbed = TRUE; - g_object_notify (G_OBJECT (screen), "keyboard-grabbed"); - } - else - meta_screen_grab_keys (screen); - - return retval; -} - -void -meta_screen_ungrab_all_keys (MetaScreen *screen, guint32 timestamp) -{ - if (screen->all_keys_grabbed) - { - ungrab_keyboard (screen->display, timestamp); - - screen->all_keys_grabbed = FALSE; - screen->keys_grabbed = FALSE; - - /* Re-establish our standard bindings */ - meta_screen_grab_keys (screen); - g_object_notify (G_OBJECT (screen), "keyboard-grabbed"); - } -} - gboolean meta_window_grab_all_keys (MetaWindow *window, guint32 timestamp) @@ -1803,7 +1755,7 @@ meta_display_process_key_event (MetaDisplay *display, screen = display->screen; - all_keys_grabbed = window ? window->all_keys_grabbed : screen->all_keys_grabbed; + all_keys_grabbed = window ? window->all_keys_grabbed : FALSE; if (!all_keys_grabbed) { handled = process_overlay_key (display, screen, event, window); diff --git a/src/core/screen-private.h b/src/core/screen-private.h index 364ca1595..7876b9901 100644 --- a/src/core/screen-private.h +++ b/src/core/screen-private.h @@ -112,7 +112,6 @@ struct _MetaScreen guint workspace_layout_overridden : 1; guint keys_grabbed : 1; - guint all_keys_grabbed : 1; int closing; diff --git a/src/core/screen.c b/src/core/screen.c index 7fa2c7734..e1dc6cd1f 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -78,7 +78,6 @@ static void on_monitors_changed (MetaMonitorManager *manager, enum { PROP_N_WORKSPACES = 1, - PROP_KEYBOARD_GRABBED, }; enum @@ -132,9 +131,6 @@ meta_screen_get_property (GObject *object, case PROP_N_WORKSPACES: g_value_set_int (value, meta_screen_get_n_workspaces (screen)); break; - case PROP_KEYBOARD_GRABBED: - g_value_set_boolean (value, screen->all_keys_grabbed ? TRUE : FALSE); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -258,16 +254,6 @@ meta_screen_class_init (MetaScreenClass *klass) g_object_class_install_property (object_class, PROP_N_WORKSPACES, pspec); - - pspec = g_param_spec_boolean ("keyboard-grabbed", - "Keyboard grabbed", - "Whether the keyboard is grabbed", - FALSE, - G_PARAM_READABLE); - - g_object_class_install_property (object_class, - PROP_KEYBOARD_GRABBED, - pspec); } static void @@ -752,7 +738,6 @@ meta_screen_new (MetaDisplay *display, set_workspace_names (screen); - screen->all_keys_grabbed = FALSE; screen->keys_grabbed = FALSE; meta_screen_grab_keys (screen); diff --git a/src/meta/keybindings.h b/src/meta/keybindings.h index 55216c243..4eeb27e81 100644 --- a/src/meta/keybindings.h +++ b/src/meta/keybindings.h @@ -32,7 +32,4 @@ gboolean meta_keybindings_set_custom_handler (const gchar *name, MetaKeyHandlerFunc handler, gpointer user_data, GDestroyNotify free_data); - -void meta_screen_ungrab_all_keys (MetaScreen *screen, guint32 timestamp); -gboolean meta_screen_grab_all_keys (MetaScreen *screen, guint32 timestamp); #endif