sculpt: let touch input drive the input seq number

This change allows the use of the sculpt manager with touch-only input.

Issue #4514
This commit is contained in:
Norman Feske 2022-05-20 16:17:17 +02:00 committed by Christian Helmuth
parent 115ac58fd0
commit a8631aeae9
2 changed files with 5 additions and 2 deletions

View File

@ -41,7 +41,10 @@ struct Gui::Session_component : Rpc_object<Gui::Session>
* Augment input stream with sequence numbers to correlate * Augment input stream with sequence numbers to correlate
* clicks with hover reports. * clicks with hover reports.
*/ */
if (ev.key_press(Input::BTN_LEFT) || ev.key_release(Input::BTN_LEFT)) { bool const advance_seq_number = ev.key_press(Input::BTN_LEFT)
|| ev.key_release(Input::BTN_LEFT)
|| ev.touch();
if (advance_seq_number) {
_global_input_seq_number.value++; _global_input_seq_number.value++;
_input_component.submit(_global_input_seq_number); _input_component.submit(_global_input_seq_number);
} }

View File

@ -691,7 +691,7 @@ struct Sculpt::Main : Input_event_handler,
{ {
bool need_generate_dialog = false; bool need_generate_dialog = false;
if (ev.key_press(Input::BTN_LEFT)) { if (ev.key_press(Input::BTN_LEFT) || ev.touch()) {
_clicked_seq_number.construct(_global_input_seq_number); _clicked_seq_number.construct(_global_input_seq_number);
_try_handle_click(); _try_handle_click();
} }