keybindings: Remove now-unused meta_screen_grab_all_keys

This commit is contained in:
Jasper St. Pierre 2014-04-28 17:28:15 -04:00
parent 1d5b4e5b2f
commit 41235fcb86
5 changed files with 1 additions and 72 deletions

View File

@ -94,10 +94,6 @@ void meta_display_init_keys (MetaDisplay *display);
void meta_display_shutdown_keys (MetaDisplay *display); void meta_display_shutdown_keys (MetaDisplay *display);
void meta_screen_grab_keys (MetaScreen *screen); void meta_screen_grab_keys (MetaScreen *screen);
void meta_screen_ungrab_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_grab_keys (MetaWindow *window);
void meta_window_ungrab_keys (MetaWindow *window); void meta_window_ungrab_keys (MetaWindow *window);
gboolean meta_window_grab_all_keys (MetaWindow *window, gboolean meta_window_grab_all_keys (MetaWindow *window,

View File

@ -1159,9 +1159,6 @@ meta_screen_grab_keys (MetaScreen *screen)
if (!META_IS_BACKEND_X11 (backend)) if (!META_IS_BACKEND_X11 (backend))
return; return;
if (screen->all_keys_grabbed)
return;
if (screen->keys_grabbed) if (screen->keys_grabbed)
return; return;
@ -1406,51 +1403,6 @@ ungrab_keyboard (MetaDisplay *display, guint32 timestamp)
XIUngrabDevice (xdisplay, META_VIRTUAL_CORE_KEYBOARD_ID, 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 gboolean
meta_window_grab_all_keys (MetaWindow *window, meta_window_grab_all_keys (MetaWindow *window,
guint32 timestamp) guint32 timestamp)
@ -1803,7 +1755,7 @@ meta_display_process_key_event (MetaDisplay *display,
screen = display->screen; 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) if (!all_keys_grabbed)
{ {
handled = process_overlay_key (display, screen, event, window); handled = process_overlay_key (display, screen, event, window);

View File

@ -112,7 +112,6 @@ struct _MetaScreen
guint workspace_layout_overridden : 1; guint workspace_layout_overridden : 1;
guint keys_grabbed : 1; guint keys_grabbed : 1;
guint all_keys_grabbed : 1;
int closing; int closing;

View File

@ -78,7 +78,6 @@ static void on_monitors_changed (MetaMonitorManager *manager,
enum enum
{ {
PROP_N_WORKSPACES = 1, PROP_N_WORKSPACES = 1,
PROP_KEYBOARD_GRABBED,
}; };
enum enum
@ -132,9 +131,6 @@ meta_screen_get_property (GObject *object,
case PROP_N_WORKSPACES: case PROP_N_WORKSPACES:
g_value_set_int (value, meta_screen_get_n_workspaces (screen)); g_value_set_int (value, meta_screen_get_n_workspaces (screen));
break; break;
case PROP_KEYBOARD_GRABBED:
g_value_set_boolean (value, screen->all_keys_grabbed ? TRUE : FALSE);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -258,16 +254,6 @@ meta_screen_class_init (MetaScreenClass *klass)
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_N_WORKSPACES, PROP_N_WORKSPACES,
pspec); 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 static void
@ -752,7 +738,6 @@ meta_screen_new (MetaDisplay *display,
set_workspace_names (screen); set_workspace_names (screen);
screen->all_keys_grabbed = FALSE;
screen->keys_grabbed = FALSE; screen->keys_grabbed = FALSE;
meta_screen_grab_keys (screen); meta_screen_grab_keys (screen);

View File

@ -32,7 +32,4 @@ gboolean meta_keybindings_set_custom_handler (const gchar *name,
MetaKeyHandlerFunc handler, MetaKeyHandlerFunc handler,
gpointer user_data, gpointer user_data,
GDestroyNotify free_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 #endif