Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine sequential mouse movement events #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion klystron
7 changes: 4 additions & 3 deletions src/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,10 @@ int helpbox(const char *title, GfxDomain *domain, GfxSurface *gfx, const Font *l

if (e.type != SDL_MOUSEMOTION || (e.motion.state)) ++got_event;

// ensure the last event is a mouse click so it gets passed to the draw/event code

if (e.type == SDL_MOUSEBUTTONDOWN || (e.type == SDL_MOUSEMOTION && e.motion.state)) break;
// Process mouse click events immediately, and batch mouse motion events
// (process the last one) to fix lag with high poll rate mice on Linux.
if (should_process_mouse(&e))
break;
}

if (got_event || gfx_domain_is_next_frame(domain))
Expand Down
7 changes: 4 additions & 3 deletions src/import/hubdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ int hub_view(hubbard_t *hub)

if (e.type != SDL_MOUSEMOTION || (e.motion.state)) ++got_event;

// ensure the last event is a mouse click so it gets passed to the draw/event code

if (e.type == SDL_MOUSEBUTTONDOWN || (e.type == SDL_MOUSEMOTION && e.motion.state)) break;
// Process mouse click events immediately, and batch mouse motion events
// (process the last one) to fix lag with high poll rate mice on Linux.
if (should_process_mouse(&e))
break;
}

if (got_event || gfx_domain_is_next_frame(domain))
Expand Down
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ int main(int argc, char **argv)

if (e.type != SDL_MOUSEMOTION || (e.motion.state) || (e.type == SDL_MOUSEMOTION && mused.mode == MENU)) ++got_event;

// ensure the last event is a mouse click so it gets passed to the draw/event code

if (e.type == SDL_MOUSEBUTTONDOWN || (e.type == SDL_MOUSEMOTION && e.motion.state))
// Process mouse click events immediately, and batch mouse motion events
// (process the last one) to fix lag with high poll rate mice on Linux.
if (should_process_mouse(&e))
break;
}

Expand Down