summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'kde-plasma/kwayland-server/files/kwayland-server-5.24.4-fix-layer-shell-reset.patch')
-rw-r--r--kde-plasma/kwayland-server/files/kwayland-server-5.24.4-fix-layer-shell-reset.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/kde-plasma/kwayland-server/files/kwayland-server-5.24.4-fix-layer-shell-reset.patch b/kde-plasma/kwayland-server/files/kwayland-server-5.24.4-fix-layer-shell-reset.patch
new file mode 100644
index 000000000000..a3a0b2067f5d
--- /dev/null
+++ b/kde-plasma/kwayland-server/files/kwayland-server-5.24.4-fix-layer-shell-reset.patch
@@ -0,0 +1,57 @@
+From 97df88c6c8af925382bb1f59b7c6ad75f28142a0 Mon Sep 17 00:00:00 2001
+From: David Edmundson <kde@davidedmundson.co.uk>
+Date: Tue, 5 Apr 2022 13:26:26 +0100
+Subject: [PATCH] Fix layer shell reset
+
+In the current form any client committing multiple times without
+attaching a buffer would unset the cached state and trigger an error.
+
+It's legal (though weird) to commit multiple times before attaching a
+buffer.
+
+We should only reset the state if we commit an empty buffer after having
+committed an existing buffer. This brings us in line with XdgShell.
+
+
+(cherry picked from commit a5c55b68589a8771cde0bf4ce552702da6fca41c)
+---
+ src/server/layershell_v1_interface.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/server/layershell_v1_interface.cpp b/src/server/layershell_v1_interface.cpp
+index 17086334..19fcd68e 100644
+--- a/src/server/layershell_v1_interface.cpp
++++ b/src/server/layershell_v1_interface.cpp
+@@ -69,6 +69,7 @@ public:
+ bool isClosed = false;
+ bool isConfigured = false;
+ bool isCommitted = false;
++ bool firstBufferAttached = false;
+
+ protected:
+ void zwlr_layer_surface_v1_destroy_resource(Resource *resource) override;
+@@ -290,8 +291,10 @@ void LayerSurfaceV1InterfacePrivate::commit()
+ return;
+ }
+
+- if (!surface->isMapped() && isCommitted) {
++ // detect reset
++ if (!surface->isMapped() && firstBufferAttached) {
+ isCommitted = false;
++ firstBufferAttached = false;
+ isConfigured = false;
+
+ current = LayerSurfaceV1State();
+@@ -303,6 +306,9 @@ void LayerSurfaceV1InterfacePrivate::commit()
+ const LayerSurfaceV1State previous = std::exchange(current, pending);
+
+ isCommitted = true; // Must set the committed state before emitting any signals.
++ if (surface->isMapped()) {
++ firstBufferAttached = true;
++ }
+
+ if (previous.acceptsFocus != current.acceptsFocus) {
+ Q_EMIT q->acceptsFocusChanged();
+--
+GitLab
+