From 29776dbd1f9fb69aa4a660cceb1b306e1e4235eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 11 May 2021 17:39:13 +0200 Subject: [PATCH] quirk: remove plasma/kwin quirk Older version of Plasma/KWin had an issue where buffer damage recorded before the buffer was attached were ignored. This appears to have been fixed now. --- CHANGELOG.md | 4 ++++ quirks.c | 23 ----------------------- quirks.h | 8 -------- render.c | 1 - 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc55631..2e14edf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,10 @@ * **bell** option in `foot.ini`; set actions in **[bell]** section instead. ### Removed + +* Buffer damage quirk for Plasma/KWin. + + ### Fixed * `generate-alt-random-writes.py --sixel` sometimes crashing, diff --git a/quirks.c b/quirks.c index 539ad9d4..61b6d046 100644 --- a/quirks.c +++ b/quirks.c @@ -66,26 +66,3 @@ 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); } - -void -quirk_kde_damage_before_attach(struct wl_surface *surface) -{ - static bool is_kde = false; - static bool initialized = false; - - if (!initialized) { - initialized = true; - - const char *cur_desktop = getenv("XDG_CURRENT_DESKTOP"); - if (cur_desktop != NULL) - is_kde = strcasestr(cur_desktop, "kde") != NULL; - - if (is_kde) - LOG_WARN("applying wl_surface_damage_buffer() workaround for KDE"); - } - - if (!is_kde) - return; - - wl_surface_damage_buffer(surface, 0, 0, INT32_MAX, INT32_MAX); -} diff --git a/quirks.h b/quirks.h index 583c0c9f..e762bb3e 100644 --- a/quirks.h +++ b/quirks.h @@ -21,11 +21,3 @@ void quirk_weston_subsurface_desync_off(struct wl_subsurface *sub); /* Shortcuts to call desync_{on,off} on all CSD subsurfaces */ void quirk_weston_csd_on(struct terminal *term); void quirk_weston_csd_off(struct terminal *term); - -/* - * KDE discards all previous damage when a buffer is attached to a - * surface. Thus, if you have recorded damage before you call - * wl_surface_attach(), call this function to record a full buffer - * damage. - */ -void quirk_kde_damage_before_attach(struct wl_surface *surface); diff --git a/render.c b/render.c index 1ba3516a..1454c84a 100644 --- a/render.c +++ b/render.c @@ -2443,7 +2443,6 @@ grid_render(struct terminal *term) xassert(buf->height % term->scale == 0); wl_surface_attach(term->window->surface, buf->wl_buf, 0, 0); - quirk_kde_damage_before_attach(term->window->surface); wl_surface_commit(term->window->surface); }