mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-04 21:42:37 +00:00
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>
This commit is contained in:
parent
91880f1e9e
commit
744e65317d
|
@ -636,6 +636,7 @@ shell_configuration(struct desktop_shell *shell)
|
||||||
struct weston_config_section *section;
|
struct weston_config_section *section;
|
||||||
char *s, *client;
|
char *s, *client;
|
||||||
int ret;
|
int ret;
|
||||||
|
int allow_zap;
|
||||||
|
|
||||||
section = weston_config_get_section(shell->compositor->config,
|
section = weston_config_get_section(shell->compositor->config,
|
||||||
"shell", NULL, NULL);
|
"shell", NULL, NULL);
|
||||||
|
@ -647,6 +648,11 @@ shell_configuration(struct desktop_shell *shell)
|
||||||
"client", &s, client);
|
"client", &s, client);
|
||||||
free(client);
|
free(client);
|
||||||
shell->client = s;
|
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,
|
weston_config_section_get_string(section,
|
||||||
"binding-modifier", &s, "super");
|
"binding-modifier", &s, "super");
|
||||||
shell->binding_modifier = get_modifier(s);
|
shell->binding_modifier = get_modifier(s);
|
||||||
|
@ -6425,10 +6431,12 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell)
|
||||||
uint32_t mod;
|
uint32_t mod;
|
||||||
int i, num_workspace_bindings;
|
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 */
|
/* 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,
|
weston_compositor_add_button_binding(ec, BTN_LEFT, 0,
|
||||||
click_to_activate_binding,
|
click_to_activate_binding,
|
||||||
shell);
|
shell);
|
||||||
|
|
|
@ -189,6 +189,7 @@ struct desktop_shell {
|
||||||
|
|
||||||
struct exposay exposay;
|
struct exposay exposay;
|
||||||
|
|
||||||
|
bool allow_zap;
|
||||||
uint32_t binding_modifier;
|
uint32_t binding_modifier;
|
||||||
uint32_t exposay_modifier;
|
uint32_t exposay_modifier;
|
||||||
enum animation_type win_animation_type;
|
enum animation_type win_animation_type;
|
||||||
|
|
|
@ -258,6 +258,10 @@ sets the effect used with the focused and unfocused windows. Can be
|
||||||
.B none.
|
.B none.
|
||||||
By default, no animation is used.
|
By default, no animation is used.
|
||||||
.TP 7
|
.TP 7
|
||||||
|
.BI "allow-zap=" true
|
||||||
|
whether the shell should quit when the Ctrl-Alt-Backspace key combination is
|
||||||
|
pressed
|
||||||
|
.TP 7
|
||||||
.BI "binding-modifier=" ctrl
|
.BI "binding-modifier=" ctrl
|
||||||
sets the modifier key used for common bindings (string), such as moving
|
sets the modifier key used for common bindings (string), such as moving
|
||||||
surfaces, resizing, rotating, switching, closing and setting the transparency
|
surfaces, resizing, rotating, switching, closing and setting the transparency
|
||||||
|
|
Loading…
Reference in a new issue