- At least, following apps are using `single-instance` feature:
- cosmic-launcher
- cosmic-app-library
- Once libcosmic text widgets supported the IME, these apps start hitting following methods of SctkWinitWindow which is `todo!()` and will crash at startup:
- `set_ime_cursor_area()`
- `set_ime_allowed()`
- `set_ime_purpose()`
- So, this PR implements these method utilizing following wayland protocols.
- zwp_text_input_v3
- zwp_text_input_manager_v3
Some widgets check the cursor position when handling the touch down
event, so we need to make sure `cursor_position` is set then, and not
only when there is a touch move event. Simply always setting it for
`WindowEvent::PointerButton` (for touch or mouse input) seems
reasonable.
We also need to avoid clearing `cursor_position` for `PointerLeft`
with a touch device. Do that only for mouse input.
Ideally Iced would handle touch input without tying to
`cursor_position`, but this should match the behavior of upstream Iced.
This seems to fix regressions since the Iced rebase in the `tour`
example, and in `cosmic-files`. `cosmic-files` seems to have some
issue using the menus with a touch device, but that doesn't seem to be a
regression.
- Should test `!= 0`, not `> 0`; can scroll in either direction
- Test both vertical and horizontal
- Use `value120` scroll if present (in which case, discrete is 0)
I guess events should really have both line and pixel scroll, since some
widgets want to use the pixel scroll values for input devices that have
both? But I guess winit and Iced both need to be changed for that...
Ideally pointer should be seperate from touch, but this should match how
Iced handles input in normal winit windows.
d475ae5b45/winit/src/window/state.rs (L165-L170)
With this, touch input for applets seems to work as expected in general.