summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget_p.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-04 13:23:26 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-06 09:36:16 +0000
commitb3fc5e1ea3eb4fe838ac716aaca4efaa5de5a814 (patch)
tree3f6a0665948c93b600a7d1c18ac91a299023ce0a /src/widgets/kernel/qwidget_p.h
parent4805714b0f5d5584fd390067b6c092ca5ee7f482 (diff)
Improve handling of screens in QWidgets.
Historically, the screen number of a QWidget was stored in QTLWExtra::screenIndex which came in via the Q_WS_QWS platform. The variable contained the screen number of the QDesktopScreenWidget and the desired screen number for widget creation (from parent widget or desktop parent widgets) and was not updated according to widget geometry or when the associated QWindow moved to another screen. Storing the screen number is problematic in Qt 5 since it may change when the list of QScreens in QGuiApplication is rearranged. This change renames it to initialScreen and changes its usage to only contain a screen number when a screen is requested by parenting on a desktop widget or reparenting. A value of -1 indicates no screen is requested and the number should be deduced from the geometry. For the usage in QDesktopScreenWidget, add a method to determine the number via index in the list of QDesktopWidget. Task-number: QTBUG-44070 Task-number: QTBUG-44213 Change-Id: I153d19073ad4b0fd14ef3d24caa6d3e76f350e82 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel/qwidget_p.h')
-rw-r--r--src/widgets/kernel/qwidget_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index b3552cba68..85e1cf93d6 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -212,7 +212,7 @@ struct QTLWExtra {
#endif
QWidgetWindow *window;
QOpenGLContext *shareContext;
- quint32 screenIndex; // index in qplatformscreenlist
+ int initialScreenIndex; // Screen number when passing a QDesktop[Screen]Widget as parent.
};
struct QWExtra {