mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 03:49:51 +01:00
xdg-shell: properly check for resource version for TILED and SUSPENDED states
fixes #6535
This commit is contained in:
parent
43c75f17eb
commit
648ac8a00b
1 changed files with 9 additions and 4 deletions
|
@ -136,10 +136,12 @@ CXDGToplevelResource::CXDGToplevelResource(SP<CXdgToplevel> resource_, SP<CXDGSu
|
||||||
wl_array_release(&arr);
|
wl_array_release(&arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_LEFT);
|
if (resource->version() >= 2) {
|
||||||
pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_RIGHT);
|
pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_LEFT);
|
||||||
pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_TOP);
|
pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_RIGHT);
|
||||||
pendingApply.states.push_back(XDG_TOPLEVEL_STATE_TILED_BOTTOM);
|
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) {
|
resource->setSetTitle([this](CXdgToplevel* r, const char* t) {
|
||||||
state.title = t;
|
state.title = t;
|
||||||
|
@ -261,6 +263,9 @@ uint32_t CXDGToplevelResource::setActive(bool active) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CXDGToplevelResource::setSuspeneded(bool sus) {
|
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();
|
bool set = std::find(pendingApply.states.begin(), pendingApply.states.end(), XDG_TOPLEVEL_STATE_SUSPENDED) != pendingApply.states.end();
|
||||||
|
|
||||||
if (sus == set)
|
if (sus == set)
|
||||||
|
|
Loading…
Reference in a new issue