Skip to content

Commit

Permalink
Do not spam window::event() when there's no active touch
Browse files Browse the repository at this point in the history
  • Loading branch information
Milek7 committed Aug 29, 2023
1 parent 421f0d9 commit 65d4cf3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions DMI/graphics/drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
bool softkeys=false;
void update_stm_windows();
UiPlatform::InputEvent last_event = {UiPlatform::InputEvent::Action::Release, 0, 0};
void process_input(UiPlatform::InputEvent ev)
void update_window_input(UiPlatform::InputEvent ev)
{
for (auto &w : active_windows)
{
Expand All @@ -32,7 +32,8 @@ void process_input(UiPlatform::InputEvent ev)
}
void present_frame()
{
process_input(last_event);
if (last_event.action != UiPlatform::InputEvent::Action::Release)
update_window_input(last_event);
update_stm_windows();
platform->set_color(DarkBlue);
platform->clear();
Expand All @@ -42,7 +43,7 @@ void present_frame()
void input_received(UiPlatform::InputEvent ev)
{
last_event = ev;
process_input(last_event);
update_window_input(last_event);
platform->on_input_event().then(input_received).detach();
}

Expand Down

0 comments on commit 65d4cf3

Please sign in to comment.