Erratic resizing of lv-tool window under GNOME Shell
kaixiong opened this issue · 10 comments
When I try to resize the lv-tool
visualization window on my GNOME Wayland desktop, the window jumps around erratically and resizes itself like it's suffering from a seizure.
@kaixiong is this with original SDL 1.2.x or with sdl12-compat? If I can trust my eyes, I get it (with X11!) on master
with sdl12-compat (1.2.60) but not with plain SDL 1 (1.2.15_p20221201). You?
@kaixiong update: Even my SDL 1 toy at https://github.com/hartwork/sdl_video_demo shows this behavior with sdl12-compat 1.2.60. Are you okay with me taking this to sdl12-compat upstream for feedback? We could try sdl12-compat Git master
before that, though. What do you think?
@hartwork I am on SDL 1.2.15, which comes with Pop_OS! 22.04.
Here's all the SDL packages on my system.
ii libsdl-image1.2:amd64 1.2.12-13build1 amd64 Image loading library for Simple DirectMedia Layer 1.2, libraries
ii libsdl1.2-dev 1.2.15+dfsg2-6 amd64 Simple DirectMedia Layer development files
ii libsdl1.2debian:amd64 1.2.15+dfsg2-6 amd64 Simple DirectMedia Layer
ii libsdl2-2.0-0:amd64 2.0.20+dfsg-2ubuntu1.22.04.1 amd64 Simple DirectMedia Layer
ii libsdl2-dev:amd64 2.0.20+dfsg-2ubuntu1.22.04.1 amd64 Simple DirectMedia Layer development files
ii libsdl2-image-2.0-0:amd64 2.0.5+dfsg1-3build1 amd64 Image loading library for Simple DirectMedia Layer 2, libraries
ii libsdl2-image-dev:amd64 2.0.5+dfsg1-3build1 amd64 Image loading library for Simple DirectMedia Layer 2, development files
ii libsdl2-mixer-2.0-0:amd64 2.0.4+dfsg1-4build1 amd64 Mixer library for Simple DirectMedia Layer 2, libraries
ii libsdl2-mixer-dev:amd64 2.0.4+dfsg1-4build1 amd64 Mixer library for Simple DirectMedia Layer 2, development files
@kaixiong interesting. Does my demo show the same behavior for you? If it does, we can e.g. rule out any problems from the way lv-tool is draining all events in one go.
@kaixiong PS: I should note that (unlike SDL 2) SDL 1 does not yet have explicit support for Wayland. Maybe use of Wayland is an important part of this.
@hartwork so I tested lv-tool and your demo under GNOME/Wayland, GNOME/X.Org and Sway.
The issue only appears with SDL 1.2. Using GNOME/X.Org did not make much difference.
Under Sway, which is Wayland based, I did notice that the SDL 1.2 window auto-centers itself at the end of each resize drag. It is somewhat well behaved.
The same is probably happening on GNOME but much less consistently or gracefully.
@kaixiong I believe I have a fix at hartwork/sdl_video_demo#8 . What do you think?
@hartwork Thanks, I have replied there. But just to keep the main discussion here, I'll repeat the basic points:
- It works, although content resizes still happen frequently. Slow content resize causes rather heavy flickering.
- Debouncing based on time may be better. When a resize event is received, a short time window follows where subsequent resize events are 'absorbed'. Once the window expires, the content resize happens based on the latest dimensions. A subsequent resize event restarts the process.
For the record @kaixiong and I agreed on debouncing at hartwork/sdl_video_demo#8 (comment) now.
Should be fixed on both master
and 0.4.x
, closing as fixed. Please re-open as needed.