From b08cc0ec6f096d0e6764486c81264c24a406bee1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 28 Jul 2014 15:55:56 +0200 Subject: Make the expose region local on all platforms QExposeEvent::region() reports a region in a random coordinate system. The behavior is undocumented and the platform plugins do different things. xcb, offscreen and ios are correct. These set the region in local coordinates, which is the most logical interpretation of the expose region. windows is almost correct, except for one occurrence. cocoa and others need changes: passing in geometry() as the exposed region is always wrong. The patch documents the expected behavior both for QExposeEvent and internally in QWindowSystemInterface. The problematic plugins are fixed to use local coordinates. Task-number: QTBUG-40470 Change-Id: I6ded3154d14254fa71d4292d8e1b5e6cf696c81a Reviewed-by: Gunnar Sletta --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index a0150b7ade..1f67170efc 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -98,7 +98,7 @@ void QEglFSWindow::create() m_flags |= HasNativeWindow; setGeometry(QRect()); // will become fullscreen - QWindowSystemInterface::handleExposeEvent(window(), geometry()); + QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size())); EGLDisplay display = static_cast(screen)->display(); QSurfaceFormat platformFormat = QEglFSHooks::hooks()->surfaceFormatFor(window()->requestedFormat()); @@ -168,8 +168,9 @@ void QEglFSWindow::resetSurface() void QEglFSWindow::setVisible(bool visible) { QList windows = screen()->windows(); + QWindow *wnd = window(); - if (window()->type() != Qt::Desktop) { + if (wnd->type() != Qt::Desktop) { if (visible) { screen()->addWindow(this); } else { @@ -180,7 +181,7 @@ void QEglFSWindow::setVisible(bool visible) } } - QWindowSystemInterface::handleExposeEvent(window(), window()->geometry()); + QWindowSystemInterface::handleExposeEvent(wnd, QRect(QPoint(0, 0), wnd->geometry().size())); if (visible) QWindowSystemInterface::flushWindowSystemEvents(); @@ -218,15 +219,17 @@ void QEglFSWindow::requestActivateWindow() if (window()->type() != Qt::Desktop) screen()->moveToTop(this); - QWindowSystemInterface::handleWindowActivated(window()); - QWindowSystemInterface::handleExposeEvent(window(), window()->geometry()); + QWindow *wnd = window(); + QWindowSystemInterface::handleWindowActivated(wnd); + QWindowSystemInterface::handleExposeEvent(wnd, QRect(QPoint(0, 0), wnd->geometry().size())); } void QEglFSWindow::raise() { - if (window()->type() != Qt::Desktop) { + QWindow *wnd = window(); + if (wnd->type() != Qt::Desktop) { screen()->moveToTop(this); - QWindowSystemInterface::handleExposeEvent(window(), window()->geometry()); + QWindowSystemInterface::handleExposeEvent(wnd, QRect(QPoint(0, 0), wnd->geometry().size())); } } @@ -237,7 +240,8 @@ void QEglFSWindow::lower() int idx = windows.indexOf(this); if (idx > 0) { screen()->changeWindowIndex(this, idx - 1); - QWindowSystemInterface::handleExposeEvent(windows.last()->window(), windows.last()->geometry()); + QWindowSystemInterface::handleExposeEvent(windows.last()->window(), + QRect(QPoint(0, 0), windows.last()->geometry().size())); } } } -- cgit v1.2.3