mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-19 15:40:31 +00:00
Add a check to allow exit command execution only when the main window is the currently running
This commit is contained in:
parent
f15589734f
commit
c5fccb1499
@ -458,9 +458,13 @@ bool CustomizedGuiManager::onProcessMessage(Message* msg)
|
||||
switch (msg->type()) {
|
||||
|
||||
case kCloseDisplayMessage: {
|
||||
// Execute the "Exit" command.
|
||||
Command* command = Commands::instance()->byId(CommandId::Exit());
|
||||
UIContext::instance()->executeCommandFromMenuOrShortcut(command);
|
||||
// Exit command is only allowed when the main window is the current
|
||||
// window running.
|
||||
if (getForegroundWindow() == App::instance()->mainWindow()) {
|
||||
// Execute the "Exit" command.
|
||||
Command* command = Commands::instance()->byId(CommandId::Exit());
|
||||
UIContext::instance()->executeCommandFromMenuOrShortcut(command);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user