summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/StackWidget.cpp2
-rw-r--r--Libraries/LibGUI/TabWidget.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/StackWidget.cpp b/Libraries/LibGUI/StackWidget.cpp
index 1f06eed24e..8af53e00a9 100644
--- a/Libraries/LibGUI/StackWidget.cpp
+++ b/Libraries/LibGUI/StackWidget.cpp
@@ -43,7 +43,7 @@ void StackWidget::set_active_widget(Widget* widget)
if (widget == m_active_widget)
return;
- bool active_widget_had_focus = m_active_widget && window() && window()->focused_widget() == m_active_widget;
+ bool active_widget_had_focus = m_active_widget && window() && (window()->focused_widget() == m_active_widget || m_active_widget->is_ancestor_of(*window()->focused_widget()));
if (m_active_widget)
m_active_widget->set_visible(false);
diff --git a/Libraries/LibGUI/TabWidget.cpp b/Libraries/LibGUI/TabWidget.cpp
index e329f9a2ac..69d8914f97 100644
--- a/Libraries/LibGUI/TabWidget.cpp
+++ b/Libraries/LibGUI/TabWidget.cpp
@@ -93,7 +93,7 @@ void TabWidget::set_active_widget(Widget* widget)
if (widget == m_active_widget)
return;
- bool active_widget_had_focus = m_active_widget && window() && window()->focused_widget() == m_active_widget;
+ bool active_widget_had_focus = m_active_widget && window() && (window()->focused_widget() == m_active_widget || m_active_widget->is_ancestor_of(*window()->focused_widget()));
if (m_active_widget)
m_active_widget->set_visible(false);