mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
kiosk-shell: Enable debug keybindings
We are missing debug keybinds in kiosk-shell so install them. Adds the binding-modifier like in desktop-shell in a helper. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
dac2f146ea
commit
f7ba35f5fc
3 changed files with 46 additions and 3 deletions
|
|
@ -1064,15 +1064,21 @@ kiosk_shell_touch_to_activate_binding(struct weston_touch *touch,
|
|||
static void
|
||||
kiosk_shell_add_bindings(struct kiosk_shell *shell)
|
||||
{
|
||||
weston_compositor_add_button_binding(shell->compositor, BTN_LEFT, 0,
|
||||
uint32_t mod = 0;
|
||||
|
||||
mod = weston_shell_get_binding_modifier(shell->config, MODIFIER_SUPER);
|
||||
|
||||
weston_compositor_add_button_binding(shell->compositor, BTN_LEFT, mod,
|
||||
kiosk_shell_click_to_activate_binding,
|
||||
shell);
|
||||
weston_compositor_add_button_binding(shell->compositor, BTN_RIGHT, 0,
|
||||
weston_compositor_add_button_binding(shell->compositor, BTN_RIGHT, mod,
|
||||
kiosk_shell_click_to_activate_binding,
|
||||
shell);
|
||||
weston_compositor_add_touch_binding(shell->compositor, 0,
|
||||
weston_compositor_add_touch_binding(shell->compositor, mod,
|
||||
kiosk_shell_touch_to_activate_binding,
|
||||
shell);
|
||||
|
||||
weston_install_debug_key_binding(shell->compositor, mod);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -212,3 +212,34 @@ weston_curtain_destroy(struct weston_curtain *curtain)
|
|||
weston_buffer_destroy_solid(curtain->buffer_ref);
|
||||
free(curtain);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
weston_shell_get_binding_modifier(struct weston_config *config,
|
||||
uint32_t default_mod)
|
||||
{
|
||||
struct weston_config_section *shell_section = NULL;
|
||||
char *mod_string = NULL;
|
||||
uint32_t mod = default_mod;
|
||||
|
||||
if (config)
|
||||
shell_section = weston_config_get_section(config, "shell", NULL, NULL);
|
||||
|
||||
if (shell_section)
|
||||
weston_config_section_get_string(shell_section,
|
||||
"binding-modifier", &mod_string, "super");
|
||||
|
||||
if (!mod_string || !strcmp(mod_string, "none"))
|
||||
mod = default_mod;
|
||||
else if (!strcmp(mod_string, "super"))
|
||||
mod = MODIFIER_SUPER;
|
||||
else if (!strcmp(mod_string, "alt"))
|
||||
mod = MODIFIER_ALT;
|
||||
else if (!strcmp(mod_string, "ctrl"))
|
||||
mod = MODIFIER_CTRL;
|
||||
else if (!strcmp(mod_string, "shift"))
|
||||
mod = MODIFIER_SHIFT;
|
||||
|
||||
free(mod_string);
|
||||
|
||||
return mod;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@
|
|||
#include "shared/helpers.h"
|
||||
#include <libweston/libweston.h>
|
||||
|
||||
#include <libweston/config-parser.h>
|
||||
#include <string.h>
|
||||
|
||||
/* parameter for weston_curtain_create() */
|
||||
struct weston_curtain_params {
|
||||
int (*get_label)(struct weston_surface *es, char *buf, size_t len);
|
||||
|
|
@ -63,3 +66,6 @@ weston_curtain_create(struct weston_compositor *compositor,
|
|||
struct weston_curtain_params *params);
|
||||
void
|
||||
weston_curtain_destroy(struct weston_curtain *curtain);
|
||||
|
||||
uint32_t
|
||||
weston_shell_get_binding_modifier(struct weston_config *config, uint32_t default_mod);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue