Skip to content

Commit

Permalink
wm: revoke curr focus if new focus is undefined
Browse files Browse the repository at this point in the history
This allows the window layouter to ensure that input entered after
switching to an empty screen won't be routed to the old focused but
no longer visible window.

Issue #5390
  • Loading branch information
nfeske authored and chelmuth committed Jan 30, 2025
1 parent 3600705 commit e27d0d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repos/gems/src/server/wm/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ struct Wm::Main : Pointer::Tracker, Gui::Session_component::Action
{
_gui_root.revoke_exclusive_input();
_focus_rom.update();
bool defined = false;
_focus_rom.xml().with_optional_sub_node("window", [&] (Xml_node const &window) {
_with_win_id_from_xml(window, [&] (Window_registry::Id id) {
_gui_root.with_gui_session(id, [&] (Capability<Gui::Session> cap) {
_focus_gui_session.focus(cap); }); }); });
_focus_gui_session.focus(cap);
defined = true; }); }); });
if (!defined)
_focus_gui_session.focus({ });
}

Signal_handler<Main> _focus_handler {
Expand Down

0 comments on commit e27d0d3

Please sign in to comment.