community
community copied to clipboard
`on_touch_move` and `on_touch_up` events are doubled when the touchring is active
Software Versions
- Python: 3.11.4
- OS: Linux Mint 20.2 Uma
- Kivy: master
- Kivy installation method: Development Install
Describe the bug
This is an issue I previously attempted to explain in #5924, but I may not have described it clearly. Let me try again.
The problem is mostly described in the title, and you can reproduce it with the following minimal code::
from kivy.config import Config
Config.set('modules', 'touchring', '')
from kivy.app import runTouchApp
from kivy.uix.widget import Widget
runTouchApp(Widget(
on_touch_down=lambda __, touch: print("down", touch.grab_current),
on_touch_move=lambda __, touch: print("move", touch.grab_current),
on_touch_up=lambda __, touch: print("up", touch.grab_current),
))
down None
move None
move <kivy.core.window.window_sdl3.WindowSDL object at 0x7f9858a5e740>
move None
move <kivy.core.window.window_sdl3.WindowSDL object at 0x7f9858a5e740>
up None
up <kivy.core.window.window_sdl3.WindowSDL object at 0x7f9858a5e740>
Cause
It's clear that the issue is caused by the touchring module not returning True when handling a grabbed touch, as shown below:
https://github.com/kivy/kivy/blob/42a3d0a62eaa54890a1e6461ecfc6199ac26a1b0/kivy/modules/touchring.py#L59-L76
Etc
Might related to #4479.