mirror of https://github.com/mgba-emu/mgba.git
Qt: Apply fullscreen during show event
This commit is contained in:
parent
147852898c
commit
6c85374b5e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -163,6 +163,7 @@ private:
|
|||
QMenu* m_mruMenu;
|
||||
ShortcutController* m_shortcutController;
|
||||
int m_playerId;
|
||||
bool m_fullscreenOnStart;
|
||||
|
||||
bool m_hitUnimplementedBiosCall;
|
||||
|
||||
|
|
Loading…
Reference in New Issue