summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@liri.io>2019-01-14 00:43:28 +0100
committerPier Luigi Fiorini <pierluigi.fiorini@liri.io>2019-01-15 10:04:02 +0000
commitfb764cd406dd64dcb4caf0df2dca8b621d80f58b (patch)
treeef342f0cf09b38a2c8166b81de44bce2ae9e8e8d
parentb70148fde1d30add67ca6dd5ef63a37842f53f81 (diff)
Track changes to window geometry for xdg-shell and xdg-shell-v6
Send window geometry every time the window is resized. [ChangeLog][QPA plugin] Send window geometry every time the window is resized. Change-Id: I8f3824c31455345be2b582e7d3a55077b47851b6 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
-rw-r--r--src/client/qwaylandshellsurface_p.h2
-rw-r--r--src/client/qwaylandwindow.cpp3
-rw-r--r--src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp8
-rw-r--r--src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h1
-rw-r--r--src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp8
-rw-r--r--src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h1
6 files changed, 17 insertions, 6 deletions
diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h
index 804056e5..f5f202d0 100644
--- a/src/client/qwaylandshellsurface_p.h
+++ b/src/client/qwaylandshellsurface_p.h
@@ -99,6 +99,8 @@ public:
virtual void propagateSizeHints() {}
+ virtual void setWindowGeometry(const QRect &rect) { Q_UNUSED(rect); }
+
private:
QWaylandWindow *m_window = nullptr;
friend class QWaylandWindow;
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index e8ff081c..2301875c 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -339,6 +339,9 @@ void QWaylandWindow::setGeometry(const QRect &rect)
QRect exposeGeometry(QPoint(), geometry().size());
if (exposeGeometry != mLastExposeGeometry)
sendExposeEvent(exposeGeometry);
+
+ if (mShellSurface)
+ mShellSurface->setWindowGeometry(QRect(QPoint(0, 0), window()->frameGeometry().size()));
}
void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset)
diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
index 6652c876..60540fb0 100644
--- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
+++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp
@@ -94,9 +94,6 @@ void QWaylandXdgSurfaceV6::Toplevel::applyConfigure()
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_xdgSurface->setSizeHints();
m_applied = m_pending;
@@ -318,6 +315,11 @@ void QWaylandXdgSurfaceV6::propagateSizeHints()
m_window->commit();
}
+void QWaylandXdgSurfaceV6::setWindowGeometry(const QRect &rect)
+{
+ set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height());
+}
+
void QWaylandXdgSurfaceV6::setSizeHints()
{
if (m_toplevel && m_window) {
diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h
index 62c13157..f77a4d4b 100644
--- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h
+++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h
@@ -89,6 +89,7 @@ public:
void applyConfigure() override;
bool wantsDecorations() const override;
void propagateSizeHints() override;
+ void setWindowGeometry(const QRect &rect) override;
void setSizeHints();
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index fc515ca1..78b7b45c 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -104,9 +104,6 @@ void QWaylandXdgSurface::Toplevel::applyConfigure()
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_xdgSurface->setSizeHints();
m_applied = m_pending;
@@ -352,6 +349,11 @@ void QWaylandXdgSurface::propagateSizeHints()
m_window->commit();
}
+void QWaylandXdgSurface::setWindowGeometry(const QRect &rect)
+{
+ set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height());
+}
+
void QWaylandXdgSurface::setSizeHints()
{
if (m_toplevel && m_window) {
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
index c39ccde3..8f8682a4 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
@@ -93,6 +93,7 @@ public:
void applyConfigure() override;
bool wantsDecorations() const override;
void propagateSizeHints() override;
+ void setWindowGeometry(const QRect &rect) override;
void setSizeHints();