Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions os/osx/window.mm
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,12 @@ - (void)noResponderFor:(SEL)eventSelector
@autoreleasepool {
[m_nsWindow removeImpl];

// Select other window
{
// Select other window only if this window is the current key window,
// otherwise we'd deactivate the actual key window and generate a
// spurious windowDidResignKey: on it.
// For example: after an undo, when the tip window is destroyed (which isn't the key window)
// the main window would lose its focus (issue aseprite/aseprite#5974).
if ([m_nsWindow isKeyWindow]) {
auto app = [NSApplication sharedApplication];
auto index = [app.windows indexOfObject:m_nsWindow];
if (index + 1 < app.windows.count) {
Expand Down
Loading