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>
This commit is contained in:
parent
8d23c3b5b8
commit
a9c9f52620
@ -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) {
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
void applyConfigure() override;
|
||||
bool wantsDecorations() const override;
|
||||
void propagateSizeHints() override;
|
||||
void setWindowGeometry(const QRect &rect) override;
|
||||
|
||||
void setSizeHints();
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
void applyConfigure() override;
|
||||
bool wantsDecorations() const override;
|
||||
void propagateSizeHints() override;
|
||||
void setWindowGeometry(const QRect &rect) override;
|
||||
|
||||
void setSizeHints();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user