Permalink
Browse files

MacOSX: Fix fullscreen mode.

Due to slightly different behaviour of Qt on the various platforms, fullscreen
mode did not work correcyly on MacOSX. This fixes it.
  • Loading branch information...
1 parent 25755f8 commit 33a8e9e0cc4819ee995a373d0d1790540b0624e2 Frédéric Devernay committed with marlam Dec 19, 2010
Showing with 9 additions and 11 deletions.
  1. +9 −11 src/video_output_opengl_qt.cpp
@@ -346,19 +346,12 @@ void video_output_opengl_qt::open(
}
}
- if (state.fullscreen)
- {
- enter_fullscreen();
- }
- else
- {
- _widget->resize(video_output_opengl::win_width(), video_output_opengl::win_height());
- }
+
+ _widget->resize(video_output_opengl::win_width(), video_output_opengl::win_height());
if (flags & video_output::center)
{
center();
}
- set_state(state);
QGridLayout *container_layout = new QGridLayout();
container_layout->addWidget(_widget, 0, 0);
@@ -368,6 +361,11 @@ void video_output_opengl_qt::open(
delete _container_widget->layout();
_container_widget->setLayout(container_layout);
_container_widget->adjustSize();
+ if (state.fullscreen)
+ {
+ enter_fullscreen();
+ }
+ set_state(state);
_widget->show();
_container_widget->show();
@@ -413,6 +411,7 @@ void video_output_opengl_qt::enter_fullscreen()
{
if (!state().fullscreen)
{
+ state().fullscreen = true;
if (_container_is_external)
{
_container_widget->setWindowFlags(Qt::Window);
@@ -421,14 +420,14 @@ void video_output_opengl_qt::enter_fullscreen()
_container_widget->setCursor(Qt::BlankCursor);
_container_widget->show();
_widget->setFocus(Qt::OtherFocusReason);
- state().fullscreen = true;
}
}
void video_output_opengl_qt::exit_fullscreen()
{
if (state().fullscreen)
{
+ state().fullscreen = false;
if (_container_is_external)
{
_container_widget->setWindowFlags(Qt::Widget);
@@ -438,7 +437,6 @@ void video_output_opengl_qt::exit_fullscreen()
_widget->resize(video_output_opengl::win_width(), video_output_opengl::win_height());
_container_widget->show();
_widget->setFocus(Qt::OtherFocusReason);
- state().fullscreen = false;
}
}

0 comments on commit 33a8e9e

Please sign in to comment.