From 1f6fa70a4ed35224b74d3f6631a29e961b2ba155 Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Jan 21 2020 03:21:14 +0000 Subject: fix activate window behavior --- diff --git a/toonz/sources/toonz/pane.cpp b/toonz/sources/toonz/pane.cpp index e3d08a2..463ae26 100644 --- a/toonz/sources/toonz/pane.cpp +++ b/toonz/sources/toonz/pane.cpp @@ -31,6 +31,7 @@ #include #include #include +#include extern TEnv::StringVar EnvSafeAreaName; @@ -124,12 +125,15 @@ void TPanel::onCloseButtonPressed() { */ void TPanel::enterEvent(QEvent *event) { // Only when Toonz application is active - if (qApp->activeWindow()) { + QWidget *w = qApp->activeWindow(); + if (w) { widgetFocusOnEnter(); // Some panels (e.g. Viewer, StudioPalette, Palette, ColorModel) are // activated when mouse enters. Viewer is activatable only when being // docked. - if (isActivatableOnEnter()) activateWindow(); + // Active windows will NOT switch when the current active window is dialog. + if (qobject_cast(w) == 0 && isActivatableOnEnter()) + activateWindow(); event->accept(); } else event->accept();