windowManager: Implement keybinding_filter hook

We are currently using a hack to allow a select set of keybindings
in the overview. Implement the new MetaPlugin keybinding_filter
hook, which provides a cleaner way to achieve the same.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
This commit is contained in:
Florian Müllner
2012-08-20 10:38:13 +02:00
parent 490206b5b2
commit 034408971d
5 changed files with 67 additions and 84 deletions

View File

@@ -26,6 +26,7 @@ enum
SWITCH_WORKSPACE,
KILL_SWITCH_WORKSPACE,
KILL_WINDOW_EFFECTS,
FILTER_KEYBINDING,
LAST_SIGNAL
};
@@ -115,6 +116,14 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 1,
META_TYPE_WINDOW_ACTOR);
shell_wm_signals[FILTER_KEYBINDING] =
g_signal_new ("filter-keybinding",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
g_signal_accumulator_true_handled, NULL, NULL,
G_TYPE_BOOLEAN, 1,
META_TYPE_KEY_BINDING);
}
void
@@ -267,6 +276,17 @@ _shell_wm_destroy (ShellWM *wm,
g_signal_emit (wm, shell_wm_signals[DESTROY], 0, actor);
}
gboolean
_shell_wm_filter_keybinding (ShellWM *wm,
MetaKeyBinding *binding)
{
gboolean rv;
g_signal_emit (wm, shell_wm_signals[FILTER_KEYBINDING], 0, binding, &rv);
return rv;
}
/**
* shell_wm_new:
* @plugin: the #MetaPlugin