diff options
-rw-r--r-- | src/gui/kernel/qapplication_lite.cpp | 44 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_p.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 15 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 4 |
4 files changed, 67 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_lite.cpp b/src/gui/kernel/qapplication_lite.cpp index 491dd02..6008a9f 100644 --- a/src/gui/kernel/qapplication_lite.cpp +++ b/src/gui/kernel/qapplication_lite.cpp @@ -828,4 +828,48 @@ void QApplicationPrivate::processTouchEvent(QWindowSystemInterface::TouchEvent * translateRawTouchEvent(e->widget.data(), e->devType, touchPoints); } +void QApplicationPrivate::reportScreenCount(int count) +{ + // signal anything listening for creation or deletion of screens + QDesktopWidget *desktop = QApplication::desktop(); + if (desktop) + emit desktop->screenCountChanged(count); +} + +void QApplicationPrivate::reportGeometryChange(int screenIndex) +{ + // signal anything listening for screen geometry changes + QDesktopWidget *desktop = QApplication::desktop(); + if (desktop) + emit desktop->resized(screenIndex); + + // make sure maximized and fullscreen windows are updated + QWidgetList list = QApplication::topLevelWidgets(); + for (int i = list.size() - 1; i >= 0; --i) { + QWidget *w = list.at(i); + if (w->isFullScreen()) + w->d_func()->setFullScreenSize_helper(); + else if (w->isMaximized()) + w->d_func()->setMaxWindowState_helper(); + } +} + +void QApplicationPrivate::reportAvailableGeometryChange(int screenIndex) +{ + // signal anything listening for screen geometry changes + QDesktopWidget *desktop = QApplication::desktop(); + if (desktop) + emit desktop->workAreaResized(screenIndex); + + // make sure maximized and fullscreen windows are updated + QWidgetList list = QApplication::topLevelWidgets(); + for (int i = list.size() - 1; i >= 0; --i) { + QWidget *w = list.at(i); + if (w->isFullScreen()) + w->d_func()->setFullScreenSize_helper(); + else if (w->isMaximized()) + w->d_func()->setMaxWindowState_helper(); + } +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index f06826d..e272a36 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -496,6 +496,10 @@ public: static void processUserEvent(QWindowSystemInterface::UserEvent *e); + static void reportScreenCount(int count); + static void reportGeometryChange(int screenIndex); + static void reportAvailableGeometryChange(int screenIndex); + #endif #ifdef Q_WS_QWS diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 102d1a3..cd466e3 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -142,4 +142,19 @@ void QWindowSystemInterface::handleTouchEvent(QWidget *tlw, ulong timestamp, QEv QWindowSystemInterfacePrivate::queueUserEvent(e); } +void QWindowSystemInterface::handleScreenGeometryChange(int screenIndex) +{ + QApplicationPrivate::reportGeometryChange(screenIndex); +} + +void QWindowSystemInterface::handleScreenAvailableGeometryChange(int screenIndex) +{ + QApplicationPrivate::reportAvailableGeometryChange(screenIndex); +} + +void QWindowSystemInterface::handleScreenCountChange(int count) +{ + QApplicationPrivate::reportScreenCount(count); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index efb515f..8c69218 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -97,6 +97,10 @@ public: static void handleEnterEvent(QWidget *w); static void handleLeaveEvent(QWidget *w); + // Changes to the screen + static void handleScreenGeometryChange(int screenIndex); + static void handleScreenAvailableGeometryChange(int screenIndex); + static void handleScreenCountChange(int count); class UserEvent { public: |