From 648ac8a00b0d68a9e3a86e928b30a490870dbed6 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 16 Jun 2024 16:46:15 +0200 Subject: [PATCH] xdg-shell: properly check for resource version for TILED and SUSPENDED states fixes #6535 --- src/protocols/XDGShell.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp index 49b7b417..dddc3bca 100644 --- a/src/protocols/XDGShell.cpp +++ b/src/protocols/XDGShell.cpp @@ -136,10 +136,12 @@ CXDGToplevelResource::CXDGToplevelResource(SP resource_, SPversion() >= 2) { + pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_LEFT); + pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_RIGHT); + pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_TOP); + pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_BOTTOM); + } resource->setSetTitle([this](CXdgToplevel* r, const char* t) { state.title = t; @@ -261,6 +263,9 @@ uint32_t CXDGToplevelResource::setActive(bool active) { } uint32_t CXDGToplevelResource::setSuspeneded(bool sus) { + if (resource->version() < 6) + return owner->scheduleConfigure(); // SUSPENDED is since 6 + bool set = std::find(pendingApply.states.begin(), pendingApply.states.end(), XDG_TOPLEVEL_STATE_SUSPENDED) != pendingApply.states.end(); if (sus == set)