wm: forward mode change signal to viewless clients

Fixes #5284
This commit is contained in:
Christian Prochaska 2024-07-11 20:05:13 +02:00 committed by Christian Helmuth
parent 8ef88ae084
commit 6acfe8a41e

View File

@ -522,6 +522,9 @@ class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
Signal_handler<Session_component> _input_handler {
_env.ep(), *this, &Session_component::_handle_input };
Signal_handler<Session_component> _mode_handler {
_env.ep(), *this, &Session_component::_handle_mode_change };
Point _input_origin() const
{
if (Top_level_view const *v = _top_level_views.first())
@ -632,6 +635,16 @@ class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
}
}
void _handle_mode_change()
{
/*
* Inform a viewless client about the upstream
* mode change.
*/
if (_mode_sigh.valid() && !_top_level_views.first())
Signal_transmitter(_mode_sigh).submit();
}
/**
* Input_origin_changed_handler interface
*/
@ -798,6 +811,7 @@ class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
_view_handle_registry(session_alloc)
{
_gui_input.sigh(_input_handler);
_session.mode_sigh(_mode_handler);
_input_session.event_queue().enabled(true);
}