aboutsummaryrefslogtreecommitdiff
path: root/quirks.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-01 11:54:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-01 11:54:27 +0000
commitb8d79c719b77fb1e9f958353c62aea09d592067b (patch)
treec0990b35f87a6f828c77e06a0c5294f1b54aa272 /quirks.c
parentrender: search: kwin has problems with a resizing/repositioned sub-surface (diff)
render: search: mark visible portion of sub-surface opaque
Diffstat (limited to 'quirks.c')
-rw-r--r--quirks.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/quirks.c b/quirks.c
new file mode 100644
index 00000000..a1b1bafe
--- /dev/null
+++ b/quirks.c
@@ -0,0 +1,35 @@
+#include "quirks.h"
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+void
+quirk_weston_subsurface_desync(struct wl_subsurface *sub)
+{
+ /*
+ * On weston (8.0), synchronized subsurfaces aren't updated
+ * correctly.
+
+ * They appear to render once, but after that, updates are
+ * sporadic. Sometimes they update, most of the time they
+ * don't.
+ *
+ * Adding explicit parent surface commits right after the
+ * subsurface commit doesn't help (and would be useless anyway,
+ * since it would defeat the purpose of having the subsurface
+ * synchronized in the first place).
+ */
+
+ static bool is_weston = false;
+ static bool initialized = false;
+
+ if (!initialized) {
+ initialized = true;
+ is_weston = getenv("WESTON_CONFIG_FILE") != NULL;
+ }
+
+ if (!is_weston)
+ return;
+
+ wl_subsurface_set_desync(sub);
+}