Fixed exiting fullscreen when a QVideoWidget is embedded in another QWidget.
Requires change I3616dc0f in qtbase to work.
Because of a bug in some X window managers, the order in which
setWindowFlags() and showNormal() are called has been changed.
Change-Id: I335d47a3a1d9ce517978cad35597d72312150db1
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
void VideoWidget::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Escape && isFullScreen()) {
- showNormal();
+ setFullScreen(false);
event->accept();
} else if (event->key() == Qt::Key_Enter && event->modifiers() & Qt::Key_Alt) {
{
Q_D(QVideoWidget);
- if (fullScreen) {
- Qt::WindowFlags flags = windowFlags();
+ Qt::WindowFlags flags = windowFlags();
+ if (fullScreen) {
d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow);
flags |= Qt::Window;
flags &= ~Qt::SubWindow;
showFullScreen();
} else {
+ flags &= ~(Qt::Window | Qt::SubWindow); //clear the flags...
+ flags |= d->nonFullScreenFlags; //then we reset the flags (window and subwindow)
+ setWindowFlags(flags);
+
showNormal();
}
}
if (d->currentControl)
d->currentControl->setFullScreen(false);
- if (d->wasFullScreen) {
- flags &= ~(Qt::Window | Qt::SubWindow); //clear the flags...
- flags |= d->nonFullScreenFlags; //then we reset the flags (window and subwindow)
- setWindowFlags(flags);
-
+ if (d->wasFullScreen)
emit fullScreenChanged(d->wasFullScreen = false);
- }
}
}
return QWidget::event(event);