From 90336adc178f977d271c10fc132e6834b79f0bd9 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 31 May 2018 11:26:34 +0200 Subject: [PATCH] Client: Set window geometry for xdg-shell v6 and stable Eventhough, according to the protocol spec, it should work perfectly fine without setting the geometry, gnome-shell 3.28.2 chokes on it and applications get stuck in the upper right corner and can't be moved. Qt seems to be the only toolkit left that doesn't set the window geometry, so let's just do it the simple, though somewhat incorrect, way. The downside of this patch, is that the unset window geometry used to include subsurfaces that extended outside the parent surface, but here we just set it to the frameGeometry of the window. Task-number: QTBUG-68575 Change-Id: I8a9d029ff6d57bd33294658e3bfd69ff08cd38c1 Reviewed-by: Paul Olav Tvete --- .../shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp | 2 ++ .../plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp index 550575f11b5..d986bc69d1b 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp @@ -86,6 +86,8 @@ void QWaylandXdgSurfaceV6::Toplevel::applyConfigure() m_xdgSurface->m_window->handleWindowStatesChanged(statesWithoutActive); m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size); + QSize windowGeometrySize = m_xdgSurface->m_window->window()->frameGeometry().size(); + m_xdgSurface->set_window_geometry(0, 0, windowGeometrySize.width(), windowGeometrySize.height()); m_applied = m_pending; } diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 4097cecefa3..183576da0c1 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -86,6 +86,8 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() m_xdgSurface->m_window->handleWindowStatesChanged(statesWithoutActive); m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size); + QSize windowGeometrySize = m_xdgSurface->m_window->window()->frameGeometry().size(); + m_xdgSurface->set_window_geometry(0, 0, windowGeometrySize.width(), windowGeometrySize.height()); m_applied = m_pending; }