Emit ScreenChanged events on X11

We do not currently emit screenchanged events when a window is moved
to another screen on X11.

This patch emits the event when a window no longer intersects with
its current screen, and switches to the first intersecting screen.

Change-Id: Ie40d6eb67b85bd961eeb348bc43e4f308ee22dba
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Allan Sandfeld Jensen 2014-02-03 18:00:27 +01:00 committed by The Qt Project
parent fe3637a70f
commit 57fe9bd2c6

View File

@ -1584,6 +1584,16 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
QPlatformWindow::setGeometry(rect);
QWindowSystemInterface::handleGeometryChange(window(), rect);
if (!m_screen->availableGeometry().intersects(rect)) {
Q_FOREACH (QPlatformScreen* screen, m_screen->virtualSiblings()) {
if (screen->availableGeometry().intersects(rect)) {
m_screen = static_cast<QXcbScreen*>(screen);
QWindowSystemInterface::handleWindowScreenChanged(window(), m_screen->QPlatformScreen::screen());
break;
}
}
}
m_configureNotifyPending = false;
if (m_deferredExpose) {