diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-11-02 12:45:11 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-11-03 08:13:14 +0000 |
commit | d6cef755f6874190d144d4d574c3c0d78f38dec4 (patch) | |
tree | 99db93cd3012c8e25ad5bf1361903556ea8f8e54 /src/multimediawidgets/qvideowidget_p.h | |
parent | 82c70bce11abea285a5e06a357da4c9434db0529 (diff) |
Fix QVideoWidget::setFullScreen()
setFullScreen(true) would always cause the video widget to be shown
on the primary screen instead of the current screen the app is being
shown on.
The reason for this is that setting the Qt::Window flag on the widget
will cause its position to be interpreted as relative to the screen
instead of its parent. This position is usually on the first screen,
so showFullScreen() will show it there.
Fix this by moving the video widget to the physical position on the
screen that it had inside its widget hierarchy before calling
showFullScreen(). Also restore that position on setFullScreen(false),
so that its position is correctly restored even without layouts.
Fixes: QTBUG-97895
Pick-to: 6.2
Change-Id: I5207afb276e9369938d1c3d8814d9878367c6895
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/multimediawidgets/qvideowidget_p.h')
-rw-r--r-- | src/multimediawidgets/qvideowidget_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/multimediawidgets/qvideowidget_p.h b/src/multimediawidgets/qvideowidget_p.h index 4b75a4c84..9a79f58ed 100644 --- a/src/multimediawidgets/qvideowidget_p.h +++ b/src/multimediawidgets/qvideowidget_p.h @@ -71,6 +71,7 @@ public: QVideoWindow *videoWindow = nullptr; QWidget *windowContainer = nullptr; + QPoint nonFullscreenPos; bool createBackend(); }; |