Skip to content

Commit

Permalink
Attempt to fix a bug with inputs on mobile
Browse files Browse the repository at this point in the history
Not really sure what the problem is, but without this change the UI
doesn't behave well on android, and some UI inputs are captured by goxel.
  • Loading branch information
guillaumechereau committed Feb 20, 2025
1 parent 0b38cca commit ec7510d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,12 @@ bool gui_icons_grid(int nb, const gui_icon_info_t *icons, int *current)

bool gui_want_capture_mouse(void)
{
return gui && gui->want_capture_mouse;
/* Note: we check both gui->want_capture_mouse and
* io.WantCaptureMouse otherwise there seems to be some subtle input
* errors on mobile */
gui_init();
ImGuiIO& io = ImGui::GetIO();
return (gui && gui->want_capture_mouse) || io.WantCaptureMouse;
}

bool gui_context_menu_begin(const char *label)
Expand Down

0 comments on commit ec7510d

Please sign in to comment.