Skip to content

Commit e2b1a1e

Browse files
Fix window focus when closing Palette Editor
1 parent 3ae1e40 commit e2b1a1e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ui/paletteeditor.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,13 @@ void PaletteEditor::closeEvent(QCloseEvent*) {
283283
saveGeometry(),
284284
saveState()
285285
);
286+
287+
// Opening the color search window then closing the Palette Editor sets
288+
// focus to the main editor window instead of the parent (Tileset Editor).
289+
// Make sure the parent is active when we close.
290+
auto p = dynamic_cast<QWidget*>(parent());
291+
if (p && p->isVisible()) {
292+
p->raise();
293+
p->activateWindow();
294+
}
286295
}

0 commit comments

Comments
 (0)