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 <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2018-02-09 21:13:32 +00:00
parent 1b70ca4979
commit 30ac85b9c0

View file

@ -274,6 +274,15 @@ void QApple::on_actionMemory_triggered()
void QApple::on_actionOptions_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); const Preferences::Data currentOptions = getCurrentOptions(myGamepad);
QSettings settings; // the function will "modify" it QSettings settings; // the function will "modify" it
@ -284,6 +293,11 @@ void QApple::on_actionOptions_triggered()
const Preferences::Data newOptions = myPreferences.getData(); const Preferences::Data newOptions = myPreferences.getData();
setNewOptions(currentOptions, newOptions, myGamepad); setNewOptions(currentOptions, newOptions, myGamepad);
} }
if (running)
{
actionStart->trigger();
}
} }
void QApple::on_actionSave_state_triggered() void QApple::on_actionSave_state_triggered()