From 5a89ac67eb7ee7713034f39a27ce31eb15bc481f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 11 Mar 2020 16:10:14 +0100 Subject: [PATCH 1/2] config: add str_to_bool() --- config.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index dc4917b1..912ac75a 100644 --- a/config.c +++ b/config.c @@ -110,6 +110,15 @@ get_config_path(void) return NULL; } +static bool +str_to_bool(const char *s) +{ + return strcasecmp(s, "on") == 0 || + strcasecmp(s, "true") == 0 || + strcasecmp(s, "yes") == 0 || + strtoul(s, NULL, 0) > 0; +} + static bool str_to_ulong(const char *s, int base, unsigned long *res) { @@ -169,11 +178,7 @@ parse_section_main(const char *key, const char *value, struct config *conf, } else if (strcmp(key, "login-shell") == 0) { - conf->login_shell = ( - strcasecmp(value, "on") == 0 || - strcasecmp(value, "true") == 0 || - strcasecmp(value, "yes") == 0) || - strtoul(value, NULL, 0) > 0; + conf->login_shell = str_to_bool(value); } else if (strcmp(key, "geometry") == 0) { From 51a9ff6b04896023dd5d6a4f40ec4395ab82de71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 12 Mar 2020 09:31:25 +0100 Subject: [PATCH 2/2] quirks: weston_csd_{on,off}: don't do anything in fullscreen mode --- quirks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quirks.c b/quirks.c index 6db96e46..05d2dd5f 100644 --- a/quirks.c +++ b/quirks.c @@ -61,6 +61,8 @@ quirk_weston_csd_on(struct terminal *term) { if (term->window->use_csd != CSD_YES) return; + if (term->window->is_fullscreen) + return; for (int i = 0; i < ALEN(term->window->csd.surface); i++) quirk_weston_subsurface_desync_on(term->window->csd.sub_surface[i]); @@ -71,6 +73,8 @@ quirk_weston_csd_off(struct terminal *term) { if (term->window->use_csd != CSD_YES) return; + if (term->window->is_fullscreen) + return; for (int i = 0; i < ALEN(term->window->csd.surface); i++) quirk_weston_subsurface_desync_off(term->window->csd.sub_surface[i]);