summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2023-11-16 15:01:50 +0000
committerLiang Qi <liang.qi@qt.io>2023-12-11 10:41:03 +0000
commit0afaafef3916de86abaf5204c8b8350697ac15e8 (patch)
tree010adfe9185c37963d5523cad5172234b0258f14
parentb109438973aaec7124390ca99ec54193feff5046 (diff)
client: If the window minimized state is requested do not forward other states
In QWindowPrivate::effectiveState if the minimize flag is requested all other states are cleared. This makes sense for the internal representation, but we do not want to send the unset maximised state across the wire. Fixes: QTBUG-119136 Pick-to: 6.7 6.6 Change-Id: I9b758c67ce11420b421a295fe3e65b68bf546027 Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index d1f0a9b08..57370f359 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -178,6 +178,15 @@ void QWaylandXdgSurface::Toplevel::requestWindowStates(Qt::WindowStates states)
// Re-send what's different from the applied state
Qt::WindowStates changedStates = m_applied.states ^ states;
+ // Minimized state is not reported by the protocol, so always send it
+ if (states & Qt::WindowMinimized) {
+ set_minimized();
+ m_xdgSurface->window()->handleWindowStatesChanged(states & ~Qt::WindowMinimized);
+ // The internal window state whilst minimized is not maximised or fullscreen, but we don't want to
+ // update the compositors cached version of this state
+ return;
+ }
+
if (changedStates & Qt::WindowMaximized) {
if (states & Qt::WindowMaximized)
set_maximized();
@@ -195,11 +204,7 @@ void QWaylandXdgSurface::Toplevel::requestWindowStates(Qt::WindowStates states)
unset_fullscreen();
}
- // Minimized state is not reported by the protocol, so always send it
- if (states & Qt::WindowMinimized) {
- set_minimized();
- m_xdgSurface->window()->handleWindowStatesChanged(states & ~Qt::WindowMinimized);
- }
+
}
QtWayland::xdg_toplevel::resize_edge QWaylandXdgSurface::Toplevel::convertToResizeEdges(Qt::Edges edges)