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. --- wayland.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index 1987c72a..140c3de9 100644 --- a/wayland.c +++ b/wayland.c @@ -551,12 +551,12 @@ xdg_toplevel_decoration_configure(void *data, switch (mode) { case ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE: LOG_DBG("using client-side decorations"); - win->use_csd = true; + win->use_csd = CSD_YES; break; case ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE: LOG_DBG("using server-side decorations"); - win->use_csd = false; + win->use_csd = CSD_NO; break; default: @@ -902,7 +902,7 @@ wayl_win_init(struct terminal *term) struct wl_window *win = calloc(1, sizeof(*win)); win->term = term; - win->use_csd = true; + win->use_csd = CSD_UNKNOWN; win->surface = wl_compositor_create_surface(wayl->compositor); if (win->surface == NULL) { -- cgit v1.3