From 32939fa7b5225fc5883b9888cbc6e6ddd8d6aee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sat, 6 May 2017 19:52:41 +0200 Subject: [PATCH] Fix regression for timestamp handling for Xwayland windows Summary: Change 0bec9ad7337536e319c17c5684d97e1156399fdb introduced a regrssion on Wayland. On Wayland getTimestamp always returns 0, thus the X11 timestamp gets reset again and again. This results in broken interaction for Xwayland windows as the broken unit tests show. This change addresses the regression by ignoring a value of 0. It means the addressed bug is still present on Wayland for X11 windows as the timestamp doesn't get updated properly. This requires further changes. Test Plan: TestShade works again, testX11TimestampUpdate still works Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D5731 --- main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.h b/main.h index 6706c0faf5..cdbabec95c 100644 --- a/main.h +++ b/main.h @@ -109,7 +109,7 @@ public: Always }; void setX11Time(xcb_timestamp_t timestamp, TimestampUpdate force = TimestampUpdate::OnlyIfLarger) { - if (timestamp > m_x11Time || force == TimestampUpdate::Always) { + if ((timestamp > m_x11Time || force == TimestampUpdate::Always) && timestamp != 0) { m_x11Time = timestamp; } }