1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:45:07 +00:00

LibGUI: Don't consider a GWidget focused if the window is inactive.

This commit is contained in:
Andreas Kling 2019-01-26 21:58:43 +01:00
parent 25d045dee5
commit 2e370fa4d5
5 changed files with 24 additions and 5 deletions

View file

@ -81,6 +81,7 @@ void GWindow::event(GEvent& event)
ASSERT(result.widget);
return result.widget->event(*local_event);
}
return;
}
if (event.is_paint_event()) {
@ -94,6 +95,7 @@ void GWindow::event(GEvent& event)
GUI_Rect gui_rect = rect;
int rc = gui_notify_paint_finished(m_window_id, &gui_rect);
ASSERT(rc == 0);
return;
}
if (event.is_key_event()) {
@ -102,7 +104,14 @@ void GWindow::event(GEvent& event)
return m_focused_widget->event(event);
}
return GObject::event(event);
if (event.type() == GEvent::WindowBecameActive || event.type() == GEvent::WindowBecameInactive) {
m_is_active = event.type() == GEvent::WindowBecameActive;
if (m_focused_widget)
m_focused_widget->update();
return;
}
GObject::event(event);
}
bool GWindow::is_visible() const