Activate the native window when asking the user to save sprite changes

This commit is contained in:
Christian Kaiser 2025-08-01 00:29:24 -03:00
parent cef92c1a38
commit dd38e238ed
2 changed files with 7 additions and 1 deletions

2
laf

@ -1 +1 @@
Subproject commit 8ec4b553f1618f7a4b47cdcf4cfc2663266111ac Subproject commit 2af2af1d1e32fe044bfafa90fcbbbced6cdcff43

View File

@ -42,6 +42,7 @@
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h" #include "fmt/format.h"
#include "ui/alert.h" #include "ui/alert.h"
#include "ui/display.h"
#include "ui/menu.h" #include "ui/menu.h"
#include "ui/message.h" #include "ui/message.h"
#include "ui/shortcut.h" #include "ui/shortcut.h"
@ -306,6 +307,11 @@ bool DocView::onCloseView(Workspace* workspace, bool quitting)
// See if the sprite has changes // See if the sprite has changes
while (m_document->isModified()) { while (m_document->isModified()) {
if (quitting) {
// Make sure the window is active so we can see the message when we close the app.
display()->nativeWindow()->activate();
}
// ask what want to do the user with the changes in the sprite // ask what want to do the user with the changes in the sprite
int ret = Alert::show(Strings::alerts_save_sprite_changes( int ret = Alert::show(Strings::alerts_save_sprite_changes(
m_document->name(), m_document->name(),