mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 21:57:55 +00:00
gui_fb: deliver initial mode signal if pending
This patch handles the case where a mode change happens in-between session creation and the registration of the mode-signal handler, which can result in a sporadic loss of response to mode changes. Noticed while working on issue #5286.
This commit is contained in:
parent
f94e0a3464
commit
8ed87dae71
@ -104,6 +104,8 @@ struct Framebuffer::Session_component : Genode::Rpc_object<Framebuffer::Session>
|
|||||||
*/
|
*/
|
||||||
Framebuffer::Mode _next_mode;
|
Framebuffer::Mode _next_mode;
|
||||||
|
|
||||||
|
bool _mode_sigh_pending = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Number of bytes used for backing the current virtual framebuffer at
|
* Number of bytes used for backing the current virtual framebuffer at
|
||||||
* the GUI server.
|
* the GUI server.
|
||||||
@ -168,6 +170,8 @@ struct Framebuffer::Session_component : Genode::Rpc_object<Framebuffer::Session>
|
|||||||
|
|
||||||
if (_mode_sigh.valid())
|
if (_mode_sigh.valid())
|
||||||
Signal_transmitter(_mode_sigh).submit();
|
Signal_transmitter(_mode_sigh).submit();
|
||||||
|
else
|
||||||
|
_mode_sigh_pending = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Gui::Area size() const
|
Gui::Area size() const
|
||||||
@ -206,6 +210,12 @@ struct Framebuffer::Session_component : Genode::Rpc_object<Framebuffer::Session>
|
|||||||
void mode_sigh(Signal_context_capability sigh) override
|
void mode_sigh(Signal_context_capability sigh) override
|
||||||
{
|
{
|
||||||
_mode_sigh = sigh;
|
_mode_sigh = sigh;
|
||||||
|
|
||||||
|
/* notify mode change that happened just before 'mode_sigh' */
|
||||||
|
if (_mode_sigh.valid() && _mode_sigh_pending) {
|
||||||
|
Signal_transmitter(_mode_sigh).submit();
|
||||||
|
_mode_sigh_pending = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void refresh(Rect rect) override
|
void refresh(Rect rect) override
|
||||||
|
Loading…
Reference in New Issue
Block a user