client: Simplify toplevel exposure tracking

m_exposeRegion was originally there to track the expose updates
requested from the client in situations where the shell integration is
filtering those events, i.e when we're waiting for the first configure
event.

The fix at e6d55239c454d454978edb7d8b17f6c993e7ba07 explicitly sends an
expose event to the whole window when we get the actual first configure
event, at which point caching the expose region at the time of the
handleExpose check is unnecessary.

Motivation for cleanup is a pending change to support
xdg_toplevel.suspended where we need to unexpose at a shell level.

Change-Id: I56c3bab91453956046c1d7f92a4395c951c48fb3
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
David Edmundson 2023-06-15 12:14:45 +01:00
parent be38fbd3f4
commit 37afa0cbaa
2 changed files with 2 additions and 8 deletions

View File

@ -365,7 +365,6 @@ bool QWaylandXdgSurface::isExposed() const
bool QWaylandXdgSurface::handleExpose(const QRegion &region)
{
if (!isExposed() && !region.isEmpty()) {
m_exposeRegion = region;
return true;
}
return false;
@ -526,17 +525,13 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial)
if (!m_configured) {
// We have to do the initial applyConfigure() immediately, since that is the expose.
applyConfigure();
m_exposeRegion = QRegion(QRect(QPoint(), m_window->geometry().size()));
QRegion exposeRegion = QRegion(QRect(QPoint(), m_window->geometry().size()));
m_window->handleExpose(exposeRegion);
} else {
// Later configures are probably resizes, so we have to queue them up for a time when we
// are not painting to the window.
m_window->applyConfigureWhenPossible();
}
if (!m_exposeRegion.isEmpty()) {
m_window->handleExpose(m_exposeRegion);
m_exposeRegion = QRegion();
}
}
bool QWaylandXdgSurface::requestActivate()

View File

@ -139,7 +139,6 @@ private:
Toplevel *m_toplevel = nullptr;
Popup *m_popup = nullptr;
bool m_configured = false;
QRegion m_exposeRegion;
uint m_pendingConfigureSerial = 0;
uint m_appliedConfigureSerial = 0;
QString m_activationToken;