Skip to content

Context switching between ImGUI and wgpu is not smooth when using touch #790

@Archer6621

Description

@Archer6621

Describe the bug

Found the bug using fastplotlib 0.6.0. They pointed me to wgpu as the potential culprit, since it handles the ImGUI integration. More details here: fastplotlib/fastplotlib#981

There, I use this example: https://fastplotlib.org/_gallery/guis/imgui_basic.html

When interacting with the ImGUI panel with touch, I can no longer immediately interact with fastplotlib graph. I first have to tap once, and then I can interact with it e.g. by holding the tap.

NOTE: this behavior when away, when I went into ./utils/imgui/imgui_renderer.py and commented out some lines in the _on_mouse method as follows:

    def _on_mouse(self, event):
        event_type = event["event_type"]
        down = event_type == "pointer_down"
        self._backend.io.add_mouse_button_event(event["button"] - 1, down)

        # if self._backend.io.want_capture_mouse:
        #     event["stop_propagation"] = True

So possibly something is off there. Strangely I didn't need to do this in the _on_mouse_move method for graph dragging to work immediately.

To Reproduce

Steps:

  1. Set up a touch screen
  2. Install fastplotlib: pip install fastplotlib[imgui]. This should also install wgpu-py as dependency.
  3. Run the demo at: https://fastplotlib.org/_gallery/guis/imgui_basic.html
  4. Interact with the ImGUI panel using touch, then try to drag the graph around.

Observed behavior

Interaction with the fastplotlib graph is not immediately possible. You have to first release your finger, and then tap again. On the first tap, the ImGUI panel loses focus, but interaction with the graph is not possible yet.

As mentioned above, this goes away when commenting out some lines in the wgpu-py code related to imgui.

Screenshots

n/a (I can make a video if it is really unclear)

Your environment

Windows       11 (10.0.26100-SP0)
CPython       3.13.5
fastplotlib   0.6.0 (with either glfw or Qt6, both show same behavior)
wgpu-py       0.29.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions