mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
parent
1a26f33469
commit
0f18ecc142
@ -65,13 +65,9 @@ static void input_callback(enum input_event_type type,
|
||||
case EVENT_TYPE_WHEEL: t = Input::Event::WHEEL; break;
|
||||
}
|
||||
|
||||
try {
|
||||
input_session().submit(Input::Event(t, code,
|
||||
absolute_x, absolute_y,
|
||||
relative_x, relative_y));
|
||||
} catch (Input::Event_queue::Overflow) {
|
||||
PWRN("input ring buffer overflow");
|
||||
}
|
||||
input_session().submit(Input::Event(t, code,
|
||||
absolute_x, absolute_y,
|
||||
relative_x, relative_y));
|
||||
}
|
||||
|
||||
|
||||
|
@ -501,22 +501,14 @@ class Wm::Nitpicker::Session_component : public Genode::Rpc_object<Session>,
|
||||
Input::Event const * const events =
|
||||
_nitpicker_input_ds.local_addr<Input::Event>();
|
||||
|
||||
try {
|
||||
while (_nitpicker_input.is_pending()) {
|
||||
while (_nitpicker_input.is_pending()) {
|
||||
|
||||
size_t const num_events = _nitpicker_input.flush();
|
||||
size_t const num_events = _nitpicker_input.flush();
|
||||
|
||||
/* we trust nitpicker to return a valid number of events */
|
||||
/* we trust nitpicker to return a valid number of events */
|
||||
|
||||
for (size_t i = 0; i < num_events; i++)
|
||||
_input_session.submit(_translate_event(events[i], input_origin));
|
||||
}
|
||||
} catch (Input::Event_queue::Overflow) {
|
||||
|
||||
PWRN("client \"%s\" does not respond to user input",
|
||||
_session_label.string());
|
||||
|
||||
_input_session.event_queue().reset();
|
||||
for (size_t i = 0; i < num_events; i++)
|
||||
_input_session.submit(_translate_event(events[i], input_origin));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,10 +43,16 @@ class Input::Session_component : public Genode::Rpc_object<Input::Session>
|
||||
|
||||
/**
|
||||
* Submit input event to event queue
|
||||
*
|
||||
* \throw Input::Event_queue::Overflow
|
||||
*/
|
||||
void submit(Input::Event event) { _event_queue.add(event); }
|
||||
void submit(Input::Event event)
|
||||
{
|
||||
try {
|
||||
_event_queue.add(event);
|
||||
} catch (Input::Event_queue::Overflow) {
|
||||
PWRN("input overflow - resetting queue");
|
||||
_event_queue.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************
|
||||
|
Loading…
Reference in New Issue
Block a user