diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 34044ec9..4c0f5752 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -218,6 +218,7 @@ void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, cons Q_UNUSED(window); Q_UNUSED(offset); + qDebug() << window << "xxxxxxx flush" << mPainting; if (mPainting) { mPendingRegion |= region; mPendingFlush = true; @@ -233,6 +234,8 @@ void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, cons mFrontBuffer = mBackBuffer; QMargins margins = windowDecorationMargins(); + + qDebug() << window << "xxxxxxxxx flush2" << window << region << offset; waylandWindow()->safeCommit(mFrontBuffer, region.translated(margins.left(), margins.top())); } diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 8b2c1227..f297c001 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -323,6 +323,7 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) void QWaylandWindow::setGeometry(const QRect &rect) { + qDebug() << static_cast(window()) << "xxxxx setGeometry!" << rect; setGeometry_helper(rect); if (window()->isVisible() && rect.isValid()) { @@ -337,6 +338,7 @@ void QWaylandWindow::setGeometry(const QRect &rect) mSentInitialResize = true; } QRect exposeGeometry(QPoint(), geometry().size()); + qDebug() << static_cast(window()) << "xxxxx setGeometry!" << exposeGeometry << rect; if (exposeGeometry != mLastExposeGeometry) sendExposeEvent(exposeGeometry); @@ -351,15 +353,18 @@ void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, cons int heightWithoutMargins = qMax(sizeWithMargins.height() - (margins.top()+margins.bottom()), 1); QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins)); + qDebug() << static_cast(window()) << "xxxxx resizeFromApplyConfigure!" << sizeWithMargins << offset << geometry; mOffset += offset; setGeometry(geometry); } void QWaylandWindow::sendExposeEvent(const QRect &rect) { - if (!(mShellSurface && mShellSurface->handleExpose(rect))) + if (!(mShellSurface && mShellSurface->handleExpose(rect))) { + qDebug() << static_cast(window()) << "xxxxx expose!" << rect; QWindowSystemInterface::handleExposeEvent(window(), rect); - else + qDebug() << static_cast(window()) << "xxxxx exposed!" << rect; + } else qCDebug(lcQpaWayland) << "sendExposeEvent: intercepted by shell extension, not sending"; mLastExposeGeometry = rect; } @@ -392,7 +397,9 @@ void QWaylandWindow::setVisible(bool visible) initWindow(); mDisplay->flushRequests(); + qDebug() << static_cast(window()) << "xxxxx before" << window()->geometry(); setGeometry(window()->geometry()); + qDebug() << static_cast(window()) << "xxxxx after" << window()->geometry(); // Don't flush the events here, or else the newly visible window may start drawing, but since // there was no frame before it will be stuck at the waitForFrameSync() in // QWaylandShmBackingStore::beginPaint(). @@ -450,6 +457,7 @@ void QWaylandWindow::applyConfigureWhenPossible() void QWaylandWindow::doApplyConfigure() { + qDebug() << static_cast(this) << mWaitingToApplyConfigure; if (!mWaitingToApplyConfigure) return; @@ -482,6 +490,7 @@ void QWaylandWindow::applyConfigure() { QMutexLocker lock(&mResizeLock); + qDebug() << static_cast(window()) << "applyConfigure" << mCanResize << mSentInitialResize; if (mCanResize || !mSentInitialResize) doApplyConfigure(); @@ -563,11 +572,13 @@ void QWaylandWindow::attachOffset(QWaylandBuffer *buffer) void QWaylandWindow::damage(const QRect &rect) { + qDebug() << static_cast(window()) << "xxxxx damage!" << rect; damage(rect.x(), rect.y(), rect.width(), rect.height()); } void QWaylandWindow::safeCommit(QWaylandBuffer *buffer, const QRegion &damage) { + qDebug() << static_cast(window())<< "safeCommit!" << damage << isExposed(); if (isExposed()) { commit(buffer, damage); } else { @@ -597,6 +608,12 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage) return; attachOffset(buffer); + qDebug() << static_cast(window()) << "xxxxx damage2!" << damage; + + if (window()->objectName() == QLatin1String("fileWindow")) { + qDebug() << "bazinga"; + } + for (const QRect &rect: damage) wl_surface::damage(rect.x(), rect.y(), rect.width(), rect.height()); Q_ASSERT(!buffer->committed()); diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index f5529813..2b53e7f4 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -312,12 +312,14 @@ void QWaylandXdgSurface::setWindowFlags(Qt::WindowFlags flags) bool QWaylandXdgSurface::isExposed() const { +// qDebug() << m_window->window() << "Surface::isExposed?" << m_configured << m_pendingConfigureSerial; return m_configured || m_pendingConfigureSerial; } bool QWaylandXdgSurface::handleExpose(const QRegion ®ion) { - if (!isExposed() && !region.isEmpty()) { + qDebug() << m_window->window() << "Surface::handleExpose" << region << isExposed() << m_exposeRegion; + if (/*!isExposed() &&*/ !region.isEmpty()) { m_exposeRegion = region; return true; } @@ -328,8 +330,13 @@ void QWaylandXdgSurface::applyConfigure() { Q_ASSERT(m_pendingConfigureSerial != 0); + qDebug() << m_window->window() << "applyConfigure!" << m_toplevel; if (m_toplevel) m_toplevel->applyConfigure(); + else { + QSize normalSize = m_window->window()->frameGeometry().size(); + m_window->resizeFromApplyConfigure(normalSize); + } m_configured = true; ack_configure(m_pendingConfigureSerial); @@ -392,6 +399,7 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) auto parentXdgSurface = static_cast(parent->shellSurface()); + qDebug() << "xxxxxxxxxxx setPopup" << parent->window(); auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner()); // set_popup expects a position relative to the parent QPoint transientPos = m_window->geometry().topLeft(); // this is absolute @@ -432,6 +440,7 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) { m_pendingConfigureSerial = serial; + qDebug() << m_window->window() << "xdg_surface_configure" << m_configured; if (!m_configured) { // We have to do the initial applyConfigure() immediately, since that is the expose. applyConfigure(); @@ -442,6 +451,8 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) m_window->applyConfigureWhenPossible(); } + qDebug() << m_window->window() << "xdg_surface_configure expose!" << m_exposeRegion; + if (!m_exposeRegion.isEmpty()) { m_window->handleExpose(m_exposeRegion); m_exposeRegion = QRegion();