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.
This commit is contained in:
Daniel Eklöf 2020-02-26 12:17:58 +01:00
parent 45ba9f9c8f
commit 2f587f6f3d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 91 additions and 57 deletions

View file

@ -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);
}