diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-04-25 19:33:45 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-05-12 12:51:05 +0000 |
| commit | 3b41379be43a21a00a776d0d136c5d1b2fe4007e (patch) | |
| tree | 13454ab49cc74a3fd6a2f8f840a25facfac2b08d /quirks.c | |
| parent | term: reset: switch modifyOtherKeys back to level 1 (diff) | |
quirks: sway does not damage surface beneath sub-surface, when unmapped
When unmapping a sub-surface, Sway <= 1.8 does not damage the surface
beneath the sub-surface.
https://github.com/swaywm/sway/issues/6960
The workaround is to manually damage the main surface. Previously,
this was done when exiting scrollback search, and after the ‘flash’
OSC. But other sub-surfaces, that may also be unmapped, did not.
This patch adds a quirk handler that does this, and calls it when:
* Exiting scrollback search
* Ending the ‘flash’ OSC
* Exiting unicode input mode
* Clearing URL labels
* Removing the scrollback position indicator
Closes #1335
Diffstat (limited to 'quirks.c')
| -rw-r--r-- | quirks.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -66,3 +66,28 @@ quirk_weston_csd_off(struct terminal *term) for (int i = 0; i < ALEN(term->window->csd.surface); i++) quirk_weston_subsurface_desync_off(term->window->csd.surface[i].sub); } + +static bool +is_sway(void) +{ + static bool is_sway = false; + static bool initialized = false; + + if (!initialized) { + initialized = true; + is_sway = getenv("SWAYSOCK") != NULL; + if (is_sway) + LOG_WARN("applying wl_surface_damage_buffer() workaround for Sway"); + } + + return is_sway; +} + +void +quirk_sway_subsurface_unmap(struct terminal *term) +{ + if (!is_sway()) + return; + + wl_surface_damage_buffer(term->window->surface, 0, 0, INT32_MAX, INT32_MAX); +} |
