summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions
diff options
context:
space:
mode:
authorMatt Hoosier <matt.hoosier@garmin.com>2018-06-22 12:10:31 -0500
committerMatt Hoosier <matt.hoosier@garmin.com>2018-06-28 15:36:41 +0000
commit4d9e127d3c3171bd796c5d6fc7c1c2f70101ad34 (patch)
tree1083176decee390be9e04460d4ea271eb7050fb3 /src/compositor/extensions
parenta1f92161be0676b048034d1d378d7a9729d1d728 (diff)
Compositor: XdgShellV6: don't send -1x-1 prior size
Addresses a corner case where the toplevel surface is initially shown maximized, then attempts to toggle down to normal windowed state. The compositor's bookkeeping had been mistakenly sending the default-constructed -1x-1 QSize rather than realizing that that a 0x0 configure event should be emitted to signify that the client should choose pick an appropriate size. [ChangeLog][Compositor] Fixed an edge case in moving an initially- maximized XdgShellV6 surface to windowed mode. Change-Id: I5cc0f501573960b9298da4e002e9569c4cb5e64e Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/compositor/extensions')
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv6integration.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellv6integration.cpp b/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
index c3cd140e1..a37ee2a3c 100644
--- a/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
@@ -168,7 +168,12 @@ void XdgToplevelV6Integration::handleUnsetMaximized()
if (!m_item->view()->isPrimary())
return;
- m_toplevel->sendUnmaximized(windowedGeometry.initialWindowSize);
+ // If no prior windowed size was recorded, send a 0x0 configure event
+ // to allow the client to choose its preferred size.
+ if (windowedGeometry.initialWindowSize.isValid())
+ m_toplevel->sendUnmaximized(windowedGeometry.initialWindowSize);
+ else
+ m_toplevel->sendUnmaximized();
}
void XdgToplevelV6Integration::handleMaximizedChanged()
@@ -215,7 +220,12 @@ void XdgToplevelV6Integration::handleUnsetFullscreen()
if (!m_item->view()->isPrimary())
return;
- m_toplevel->sendUnmaximized(windowedGeometry.initialWindowSize);
+ // If no prior windowed size was recorded, send a 0x0 configure event
+ // to allow the client to choose its preferred size.
+ if (windowedGeometry.initialWindowSize.isValid())
+ m_toplevel->sendUnmaximized(windowedGeometry.initialWindowSize);
+ else
+ m_toplevel->sendUnmaximized();
}
void XdgToplevelV6Integration::handleFullscreenChanged()