LibGUI: Switch focus if the currently focused widget is disabled

This commit is contained in:
Andreas Kling 2020-12-28 00:33:46 +01:00
commit 644d5c5404
Notes: sideshowbarker 2024-07-19 00:30:59 +09:00
3 changed files with 11 additions and 0 deletions

View file

@ -728,6 +728,10 @@ void Widget::set_enabled(bool enabled)
return IterationDecision::Continue;
});
if (!m_enabled && window() && window()->focused_widget() == this) {
window()->did_disable_focused_widget({});
}
Event e(Event::EnabledChange);
event(e);
update();