aboutsummaryrefslogtreecommitdiff
path: root/quirks.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-01 12:06:00 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-01 12:06:00 +0000
commitb6f8a2e422fe05c1c1e63d39f72857d4c480bc7c (patch)
tree46195edf4e7971344eddddb1fe8685e27f66f6a5 /quirks.c
parentrender: search: add todo to only position sub-surface on a window resize (diff)
search: enable/disable weston sub-surface desync quirk when rendering search box
Diffstat (limited to 'quirks.c')
-rw-r--r--quirks.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/quirks.c b/quirks.c
index a1b1bafe..e96ad98e 100644
--- a/quirks.c
+++ b/quirks.c
@@ -3,8 +3,8 @@
#include <stdlib.h>
#include <stdbool.h>
-void
-quirk_weston_subsurface_desync(struct wl_subsurface *sub)
+static bool
+is_weston(void)
{
/*
* On weston (8.0), synchronized subsurfaces aren't updated
@@ -19,7 +19,6 @@ quirk_weston_subsurface_desync(struct wl_subsurface *sub)
* since it would defeat the purpose of having the subsurface
* synchronized in the first place).
*/
-
static bool is_weston = false;
static bool initialized = false;
@@ -28,8 +27,23 @@ quirk_weston_subsurface_desync(struct wl_subsurface *sub)
is_weston = getenv("WESTON_CONFIG_FILE") != NULL;
}
- if (!is_weston)
+ return is_weston;
+}
+
+void
+quirk_weston_subsurface_desync_on(struct wl_subsurface *sub)
+{
+ if (!is_weston())
return;
wl_subsurface_set_desync(sub);
}
+
+void
+quirk_weston_subsurface_desync_off(struct wl_subsurface *sub)
+{
+ if (!is_weston())
+ return;
+
+ wl_subsurface_set_sync(sub);
+}