diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-03-03 17:19:47 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-03-03 17:20:09 +0000 |
| commit | e077290c56022255a986c0560f4d496a29bab55e (patch) | |
| tree | 282a7ef008fdeb4f2c1d6d9b42bf079a5f5945c8 | |
| parent | config: CSD borders are always invisible (diff) | |
quirks: add shortcut for flipping all CSD surfaces sync/desync state
| -rw-r--r-- | quirks.c | 22 | ||||
| -rw-r--r-- | quirks.h | 6 | ||||
| -rw-r--r-- | terminal.c | 20 |
3 files changed, 28 insertions, 20 deletions
@@ -7,6 +7,8 @@ #define LOG_ENABLE_DBG 0 #include "log.h" +#define ALEN(v) (sizeof(v) / sizeof(v[0])) + static bool is_weston(void) { @@ -53,3 +55,23 @@ quirk_weston_subsurface_desync_off(struct wl_subsurface *sub) wl_subsurface_set_sync(sub); } + +void +quirk_weston_csd_on(struct terminal *term) +{ + if (term->window->use_csd != CSD_YES) + return; + + for (int i = 0; i < ALEN(term->window->csd.surface); i++) + quirk_weston_subsurface_desync_on(term->window->csd.sub_surface[i]); +} + +void +quirk_weston_csd_off(struct terminal *term) +{ + if (term->window->use_csd != CSD_YES) + return; + + for (int i = 0; i < ALEN(term->window->csd.surface); i++) + quirk_weston_subsurface_desync_off(term->window->csd.sub_surface[i]); +} @@ -2,5 +2,11 @@ #include <wayland-client.h> +#include "terminal.h" + void quirk_weston_subsurface_desync_on(struct wl_subsurface *sub); void quirk_weston_subsurface_desync_off(struct wl_subsurface *sub); + +/* Shortcuts to call desync_{on,off} on all CSD subsurfaces */ +void quirk_weston_csd_on(struct terminal *term); +void quirk_weston_csd_off(struct terminal *term); @@ -1627,26 +1627,6 @@ term_restore_cursor(struct terminal *term) term->cursor.lcf = term->saved_cursor.lcf; } -static void -quirk_weston_csd_on(struct terminal *term) -{ - if (term->window->use_csd != CSD_YES) - return; - - for (int i = 0; i < ALEN(term->window->csd.surface); i++) - quirk_weston_subsurface_desync_on(term->window->csd.sub_surface[i]); -} - -static void -quirk_weston_csd_off(struct terminal *term) -{ - if (term->window->use_csd != CSD_YES) - return; - - for (int i = 0; i < ALEN(term->window->csd.surface); i++) - quirk_weston_subsurface_desync_off(term->window->csd.sub_surface[i]); -} - void term_visual_focus_in(struct terminal *term) { |
