diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_lite.cpp | 23 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_p.h | 1 |
3 files changed, 21 insertions, 6 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 5b294cc..6dbb7f2 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -812,6 +812,9 @@ void QApplicationPrivate::construct( if (qt_is_gui_used) qt_guiPlatformPlugin(); #endif +#ifdef Q_WS_LITE + QApplicationPrivate::qapp_constructed = true; +#endif } #if defined(Q_WS_X11) diff --git a/src/gui/kernel/qapplication_lite.cpp b/src/gui/kernel/qapplication_lite.cpp index 6008a9f..2b94102 100644 --- a/src/gui/kernel/qapplication_lite.cpp +++ b/src/gui/kernel/qapplication_lite.cpp @@ -86,6 +86,8 @@ static int mousePressX; static int mousePressY; static int mouse_double_click_distance = 5; +bool QApplicationPrivate::qapp_constructed = false; // QApplication::QApplication completed? + void QApplicationPrivate::processUserEvent(QWindowSystemInterface::UserEvent *e) { switch(e->type) { @@ -830,18 +832,24 @@ void QApplicationPrivate::processTouchEvent(QWindowSystemInterface::TouchEvent * void QApplicationPrivate::reportScreenCount(int count) { + // This operation only makes sense after the QApplication constructor runs + if (!QApplicationPrivate::qapp_constructed) + return; + // signal anything listening for creation or deletion of screens QDesktopWidget *desktop = QApplication::desktop(); - if (desktop) - emit desktop->screenCountChanged(count); + emit desktop->screenCountChanged(count); } void QApplicationPrivate::reportGeometryChange(int screenIndex) { + // This operation only makes sense after the QApplication constructor runs + if (!QApplicationPrivate::qapp_constructed) + return; + // signal anything listening for screen geometry changes QDesktopWidget *desktop = QApplication::desktop(); - if (desktop) - emit desktop->resized(screenIndex); + emit desktop->resized(screenIndex); // make sure maximized and fullscreen windows are updated QWidgetList list = QApplication::topLevelWidgets(); @@ -856,10 +864,13 @@ void QApplicationPrivate::reportGeometryChange(int screenIndex) void QApplicationPrivate::reportAvailableGeometryChange(int screenIndex) { + // This operation only makes sense after the QApplication constructor runs + if (!QApplicationPrivate::qapp_constructed) + return; + // signal anything listening for screen geometry changes QDesktopWidget *desktop = QApplication::desktop(); - if (desktop) - emit desktop->workAreaResized(screenIndex); + emit desktop->workAreaResized(screenIndex); // make sure maximized and fullscreen windows are updated QWidgetList list = QApplication::topLevelWidgets(); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index e272a36..58128c8 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -428,6 +428,7 @@ public: static QString graphics_system_name; #if defined(Q_WS_LITE) static QPlatformIntegration *platform_integration; + static bool qapp_constructed; #endif private: |