From 30ac85b9c0ca8f0e176debd14c64e16f348a8da1 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Fri, 9 Feb 2018 21:13:32 +0000 Subject: [PATCH] In GNOME it happens that the open file dialog is not displayed properly and become impossible to interact with it. It is displayed elsewhere (different desktop, hidden???), and sometimes it is come back. More often it forces to terminate the emulator. Signed-off-by: Andrea Odetti --- source/frontends/qapple/qapple.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/frontends/qapple/qapple.cpp b/source/frontends/qapple/qapple.cpp index e457bf6b..c7b958af 100644 --- a/source/frontends/qapple/qapple.cpp +++ b/source/frontends/qapple/qapple.cpp @@ -274,6 +274,15 @@ void QApple::on_actionMemory_triggered() void QApple::on_actionOptions_triggered() { + const bool running = actionPause->isEnabled(); + if (running) + { + // this is to overcome an issue in GNOME where the open file dialog gets lost + // if the emulator is running + // at times it can be found in a separate desktop, or it magically reappears + // but often it forces to terminate the emulator + actionPause->trigger(); + } const Preferences::Data currentOptions = getCurrentOptions(myGamepad); QSettings settings; // the function will "modify" it @@ -284,6 +293,11 @@ void QApple::on_actionOptions_triggered() const Preferences::Data newOptions = myPreferences.getData(); setNewOptions(currentOptions, newOptions, myGamepad); } + + if (running) + { + actionStart->trigger(); + } } void QApple::on_actionSave_state_triggered()