jbuchermn / newm

Wayland compositor
MIT License
960 stars 30 forks source link

Newm becomes unresponsive after "Skipping moot animation" #133

Closed Patsonical closed 2 years ago

Patsonical commented 2 years ago

Whenever this conditional triggers, it blocks all further animations. It seems as though the previous animation never finishes and subsequent ones are only added to the queue and never execute.

Debug log for a normal animation:

[DEBUG] layout.py:885 2022-07-26 12:21:48: Gesture Gesture(swipe-4)...
[DEBUG] layout.py:927 2022-07-26 12:21:48: ...SwipeToZoom
[DEBUG] layout.py:266 2022-07-26 12:21:48: Queuing overlay
[DEBUG] layout.py:288 2022-07-26 12:21:48: Thread: Starting overlay...
[DEBUG] layout.py:978 2022-07-26 12:21:48: Going to enter <newm.overlay.swipe_to_zoom_overlay.SwipeToZoomOverlay object at 0x7fe3c05ed3c0>...
[DEBUG] layout.py:997 2022-07-26 12:21:49: Going to exit overlay...
[DEBUG] layout.py:1002 2022-07-26 12:21:49: ...destroy
[DEBUG] overlay.py:44 2022-07-26 12:21:49: Overlay: Exit animation
[DEBUG] layout.py:270 2022-07-26 12:21:49: Overlay-safe animation not queued
00:00:08.570 [DEBUG] [../src/wm/wm_output.c:153] Output 1 dropped frame (29.00ms)
[DEBUG] layout.py:296 2022-07-26 12:21:49: Thread: Starting animation...
[DEBUG] overlay.py:50 2022-07-26 12:21:49: Overlay: Exit animation completed
[DEBUG] layout.py:1006 2022-07-26 12:21:49: Overlay destroyed
[DEBUG] layout.py:278 2022-07-26 12:21:49: Thread: Finishing overlay...
[DEBUG] layout.py:1010 2022-07-26 12:21:49: Resetting gesture
[DEBUG] layout.py:303 2022-07-26 12:21:49: Thread: Finishing animation...

Debug log for the final animation before freezing:

[DEBUG] layout.py:885 2022-07-26 12:21:49: Gesture Gesture(swipe-3)...
[DEBUG] layout.py:914 2022-07-26 12:21:49: ...Swipe
[DEBUG] layout.py:266 2022-07-26 12:21:49: Queuing overlay
[DEBUG] layout.py:288 2022-07-26 12:21:49: Thread: Starting overlay...
[DEBUG] layout.py:978 2022-07-26 12:21:49: Going to enter <newm.overlay.swipe_overlay.SwipeOverlay object at 0x7fe3c05edb10>...
[DEBUG] layout.py:997 2022-07-26 12:21:50: Going to exit overlay...
[DEBUG] layout.py:1002 2022-07-26 12:21:50: ...destroy
[DEBUG] overlay.py:44 2022-07-26 12:21:50: Overlay: Exit animation
[DEBUG] layout.py:270 2022-07-26 12:21:50: Overlay-safe animation not queued
00:00:09.884 [DEBUG] [../src/wm/wm_output.c:153] Output 1 dropped frame (26.00ms)
[DEBUG] layout.py:296 2022-07-26 12:21:50: Thread: Starting animation...
[DEBUG] layout.py:223 2022-07-26 12:21:50: Skipping moot animation
[DEBUG] layout.py:303 2022-07-26 12:21:50: Thread: Finishing animation...

The issue seems to be fixed by making the _animate_to call execute regardless of whether the final state is the same as the current state or not, by removing the if-statement and making the else clause (line 226) execute every time: https://github.com/jbuchermn/newm/blob/bcea8953d722adec35cb1bcf611c985897ab08db/newm/layout.py#L218-L226

This is likely a band-aid fix, as I could not locate the exact source of the issue. Something about not executing the animation is causing on_overlay_destroyed to not trigger correctly, as Overlay: Exit animation completed and Resetting gesture never appear after the freeze: https://github.com/jbuchermn/newm/blob/bcea8953d722adec35cb1bcf611c985897ab08db/newm/layout.py#L1004-L1010

jbuchermn commented 2 years ago

Thanks a lot for the detailed report. I think, implementing the "moot" animation was a bit of a quick fix, which I didn't test properly...

Unfortunately, I'm not at home and can't test, but I suspect the issue is that, in case of a such a skipped animation, the then function is not called (in check_finished, lines 199-200). Can you try adding this call before line 190 e.g.?

Patsonical commented 2 years ago

Awesome, thank you, that seems to have solved the issue (and more cleanly then my "fix" lol). I'll make a pull request with these lines added there.

jbuchermn commented 2 years ago

Just merged :)