summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorBob Ham <bob.ham@collabora.com>2016-01-12 10:21:48 +0000
committerDerek Foreman <derekf@osg.samsung.com>2016-01-12 09:24:05 -0600
commit744e65317d13bf97d66e834399df3d609ee1fbda (patch)
tree1fdcaa24a74058750e3d2f62421677c65e432e13 /desktop-shell
parent91880f1e9e612eecfeb192343378da24088fc694 (diff)
desktop-shell: Make zapping configurable
Add a new boolean weston.ini option, "allow-zap" to enable or disable the Ctrl-Alt-Backspace key combination. Signed-off-by: Bob Ham <bob.ham@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c14
-rw-r--r--desktop-shell/shell.h1
2 files changed, 12 insertions, 3 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 85664c63..474d118f 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -636,6 +636,7 @@ shell_configuration(struct desktop_shell *shell)
struct weston_config_section *section;
char *s, *client;
int ret;
+ int allow_zap;
section = weston_config_get_section(shell->compositor->config,
"shell", NULL, NULL);
@@ -647,6 +648,11 @@ shell_configuration(struct desktop_shell *shell)
"client", &s, client);
free(client);
shell->client = s;
+
+ weston_config_section_get_bool(section,
+ "allow-zap", &allow_zap, true);
+ shell->allow_zap = allow_zap;
+
weston_config_section_get_string(section,
"binding-modifier", &s, "super");
shell->binding_modifier = get_modifier(s);
@@ -6425,10 +6431,12 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell)
uint32_t mod;
int i, num_workspace_bindings;
+ if (shell->allow_zap)
+ weston_compositor_add_key_binding(ec, KEY_BACKSPACE,
+ MODIFIER_CTRL | MODIFIER_ALT,
+ terminate_binding, ec);
+
/* fixed bindings */
- weston_compositor_add_key_binding(ec, KEY_BACKSPACE,
- MODIFIER_CTRL | MODIFIER_ALT,
- terminate_binding, ec);
weston_compositor_add_button_binding(ec, BTN_LEFT, 0,
click_to_activate_binding,
shell);
diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
index c55a2255..b430fa23 100644
--- a/desktop-shell/shell.h
+++ b/desktop-shell/shell.h
@@ -189,6 +189,7 @@ struct desktop_shell {
struct exposay exposay;
+ bool allow_zap;
uint32_t binding_modifier;
uint32_t exposay_modifier;
enum animation_type win_animation_type;