Qt: Apply fullscreen during show event

This commit is contained in:
Jeffrey Pfau 2015-08-27 19:24:59 -07:00
parent 147852898c
commit 6c85374b5e
2 changed files with 10 additions and 0 deletions

View File

@ -68,6 +68,7 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent)
, m_mruMenu(nullptr)
, m_shortcutController(new ShortcutController(this))
, m_playerId(playerId)
, m_fullscreenOnStart(false)
{
setFocusPolicy(Qt::StrongFocus);
setAcceptDrops(true);
@ -469,6 +470,10 @@ void Window::showEvent(QShowEvent* event) {
rect.moveCenter(QApplication::desktop()->availableGeometry().center());
move(rect.topLeft());
}
if (m_fullscreenOnStart) {
enterFullScreen();
m_fullscreenOnStart = false;
}
}
void Window::closeEvent(QCloseEvent* event) {
@ -518,6 +523,10 @@ void Window::mouseDoubleClickEvent(QMouseEvent* event) {
}
void Window::enterFullScreen() {
if (!isVisible()) {
m_fullscreenOnStart = true;
return;
}
if (isFullScreen()) {
return;
}

View File

@ -163,6 +163,7 @@ private:
QMenu* m_mruMenu;
ShortcutController* m_shortcutController;
int m_playerId;
bool m_fullscreenOnStart;
bool m_hitUnimplementedBiosCall;