wayland: apply CSD/SSD changes in the surface configure event

The configure event asks the client to change its decoration
    mode. The configured state should not be applied immediately.
    Clients must send an ack_configure in response to this event.
    See xdg_surface.configure and xdg_surface.ack_configure for
    details.

In particular, ”the configured state should *not* be applied
immediately”.

Instead, treat CSD/SSD changes like all other window dimension related
changes: store the to-be mode in win->configure, and apply it in the
surface configure event.

This fixes an issue where foot incorrectly resized the window when the
server switched between CSD/SSD at run-time.
This commit is contained in:
Daniel Eklöf 2021-06-22 18:58:38 +02:00
parent 7632e16e36
commit 2a83202fdd
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 43 additions and 52 deletions

View file

@ -46,7 +46,7 @@ quirk_weston_subsurface_desync_off(struct wl_subsurface *sub)
void
quirk_weston_csd_on(struct terminal *term)
{
if (term->window->use_csd != CSD_YES)
if (term->window->csd_mode != CSD_YES)
return;
if (term->window->is_fullscreen)
return;
@ -58,7 +58,7 @@ quirk_weston_csd_on(struct terminal *term)
void
quirk_weston_csd_off(struct terminal *term)
{
if (term->window->use_csd != CSD_YES)
if (term->window->csd_mode != CSD_YES)
return;
if (term->window->is_fullscreen)
return;