From 2f587f6f3d29c2dbfc6625e94144bf325263d090 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 26 Feb 2020 12:17:58 +0100 Subject: csd: position CSD sub-surfaces *outside* the main window For now, this behavior is controlled with an ifdef. At least kwin seems very buggy when the decorations are positioned like this (but normally you'd use server-side decorations with kwin anyway). This commit also changes 'use_csd' to be a tri-state variable; when instantiating a window it is set to 'unknown'. If there's no decoration manager available (e.g. weston), we immediately set it to 'yes' (use CSDs). Otherwise, we wait for the decoration manager callback to indicate whether we should use CSDs or not. --- terminal.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index b568731c..fe8860ad 100644 --- a/terminal.c +++ b/terminal.c @@ -1633,14 +1633,18 @@ term_visual_focus_in(struct terminal *term) if (term->cursor_blink.active) cursor_blink_start_timer(term); -#if 1 - for (int i = 0; i < 5; i++) - wl_subsurface_set_desync(term->window->csd.sub_surface[i]); +#if 1 /* Weston seems to be buggy with synchronized CSDs */ + if (term->window->use_csd == CSD_YES) { + for (int i = 0; i < 5; i++) + wl_subsurface_set_desync(term->window->csd.sub_surface[i]); + } #endif render_csd(term); #if 1 - for (int i = 0; i < 5; i++) - wl_subsurface_set_sync(term->window->csd.sub_surface[i]); + if (term->window->use_csd == CSD_YES) { + for (int i = 0; i < 5; i++) + wl_subsurface_set_sync(term->window->csd.sub_surface[i]); + } #endif cursor_refresh(term); } @@ -1656,13 +1660,17 @@ term_visual_focus_out(struct terminal *term) cursor_blink_stop_timer(term); #if 1 - for (int i = 0; i < 5; i++) - wl_subsurface_set_desync(term->window->csd.sub_surface[i]); + if (term->window->use_csd == CSD_YES) { + for (int i = 0; i < 5; i++) + wl_subsurface_set_desync(term->window->csd.sub_surface[i]); + } #endif render_csd(term); #if 1 - for (int i = 0; i < 5; i++) - wl_subsurface_set_sync(term->window->csd.sub_surface[i]); + if (term->window->use_csd == CSD_YES) { + for (int i = 0; i < 5; i++) + wl_subsurface_set_sync(term->window->csd.sub_surface[i]); + } #endif cursor_refresh(term); } -- cgit v1.3