summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-11-16 14:25:48 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-11-24 14:49:15 +0000
commitf30b75e569332558add552cde2b988c3a65e98cb (patch)
treee4cc80c9a8c924c6988e82b8213ff207defdd2ba /src/plugins/platforms
parent0ae8ef7acb96a01f7eada5d0a9e33b6c0ccaca85 (diff)
xcb: Don't assume creating a window will result in ConfigureNotify event
We assumed that creating a window would always result in a configure notify event, so we delayed sending the initial expose event until receiving the configure notify. That strategy fails in cases where the window does not need a reconfigure after being created, such as when not running a window manager, or when creating child windows. In those cases the window is just mapped, and we ended up never sending an expose event. The problem was masked by sometimes receiving an explicit expose event from X, just after the mapped notification, which we then sent without waiting for configure. Unfortunately we can't rely on this behavior and need to remove the deferred expose event logic, so that we always ensure that at least one expose event is sent to Qt. Change-Id: I702be7f24de2a1e89c085fb6bd95bb8ff7792a27 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h2
2 files changed, 3 insertions, 13 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index d76f1245e8..6023ee6b29 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -314,8 +314,6 @@ void QXcbWindow::create()
destroy();
- m_deferredExpose = false;
- m_configureNotifyPending = true;
m_windowState = Qt::WindowNoState;
Qt::WindowType type = window()->type();
@@ -2022,12 +2020,8 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
if (newScreen != currentScreen)
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
- m_configureNotifyPending = false;
-
- if (m_deferredExpose) {
- m_deferredExpose = false;
+ if (m_mapped)
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
- }
if (m_usingSyncProtocol && m_syncState == SyncReceived)
m_syncState = SyncAndConfigureReceived;
@@ -2094,10 +2088,8 @@ void QXcbWindow::handleMapNotifyEvent(const xcb_map_notify_event_t *event)
m_mapped = true;
if (m_deferredActivation)
requestActivateWindow();
- if (m_configureNotifyPending)
- m_deferredExpose = true;
- else
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
+
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
}
}
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 41c4b4443d..43e66a774d 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -231,8 +231,6 @@ protected:
bool m_transparent;
bool m_usingSyncProtocol;
bool m_deferredActivation;
- bool m_deferredExpose;
- bool m_configureNotifyPending;
bool m_embedded;
bool m_alertState;
xcb_window_t m_netWmUserTimeWindow;