You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Wayland] Slow keypress handler causes the event to trigger multiple times #1614
Some(VirtualKeyCode::Key2) => {
std::thread::sleep(Duration::from_secs(2));// Could be any long operation, sleep is just an exampledbg!("done");}
You would expect that the window freezes for 2s, prints "done", and then continues. This is what happens on x11.
On Wayland however, instead it freezes for 2s, prints done, then freezes for 2s, prints done again, repeat infinitely.
changed the title [-][Wayland] Long keypress handler causes the event to trigger multiple times[/-][+][Wayland] Slow keypress handler causes the event to trigger multiple times[/+]on Jun 28, 2020
This could be related to a thing that on Wayland, repeat is done by clients, not by display server, so something could go out of sync on a client side, and I guess it's much more sensitive to sleeps like that. But yeah, I can repro your issue and I bet timers are borken in that case. Or winit somehow messes things up here...
On x11, doing this prints "done" 3 times, instead of the expected 2. Uncommenting the Pressed check gives the expected 1 print only. So x11 is also kinda broken?
Activity
[-][Wayland] Long keypress handler causes the event to trigger multiple times[/-][+][Wayland] Slow keypress handler causes the event to trigger multiple times[/+]kchibisov commentedon Jun 28, 2020
This could be related to a thing that on Wayland, repeat is done by clients, not by display server, so something could go out of sync on a client side, and I guess it's much more sensitive to sleeps like that. But yeah, I can repro your issue and I bet timers are borken in that case. Or winit somehow messes things up here...
JMS55 commentedon Jun 30, 2020
On x11, doing this prints "done" 3 times, instead of the expected 2. Uncommenting the Pressed check gives the expected 1 print only. So x11 is also kinda broken?
kchibisov commentedon Aug 23, 2020
Could you try #1653 for Wayland part of it?
JMS55 commentedon Aug 23, 2020
Everything's fixed! On both X11 and Wayland, it prints 2 times, or 1 time if wrapped in
if input.state == ElementState::Pressed.kchibisov commentedon Aug 23, 2020
I haven't touched X11 at all, so it's placebo. Though Wayland backend is brand new on that PR.
JMS55 commentedon Aug 23, 2020
Weird that X11 works now then, maybe my game was just being weird before. Thanks for all the work on fixing wayland stuff though!
kchibisov commentedon Aug 23, 2020
The patch haven't yet merged, so opening it for now.
Update SCTK to 0.10.0
Update SCTK to 0.10.0
Update SCTK to 0.11.0
Update SCTK to 0.11.0
Update SCTK to 0.11.0
Update SCTK to 0.11.0
Update SCTK to 0.11.0
Update SCTK to 0.11.0
Update SCTK to 0.11.0