all repos — mgba @ 6c85374b5e8bc07f0605bec8f5d6e6a56b738a6c

mGBA Game Boy Advance Emulator

Qt: Apply fullscreen during show event
Jeffrey Pfau jeffrey@endrift.com
Thu, 27 Aug 2015 19:24:59 -0700
commit

6c85374b5e8bc07f0605bec8f5d6e6a56b738a6c

parent

147852898c8c1c8b50970ea8033583c4603f9702

2 files changed, 10 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -68,6 +68,7 @@ #endif

, m_mruMenu(nullptr) , m_shortcutController(new ShortcutController(this)) , m_playerId(playerId) + , m_fullscreenOnStart(false) { setFocusPolicy(Qt::StrongFocus); setAcceptDrops(true);

@@ -469,6 +470,10 @@ QRect rect = frameGeometry();

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 @@ toggleFullScreen();

} void Window::enterFullScreen() { + if (!isVisible()) { + m_fullscreenOnStart = true; + return; + } if (isFullScreen()) { return; }
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -163,6 +163,7 @@ QList<QString> m_mruFiles;

QMenu* m_mruMenu; ShortcutController* m_shortcutController; int m_playerId; + bool m_fullscreenOnStart; bool m_hitUnimplementedBiosCall;