LiveSplitOne
LiveSplitOne copied to clipboard
(Linux) Segments disappear as soon as the timer starts
See attached video for example. It doesn't matter if it's in focus, out of focus, using a keyboard shortcut, or with a control button. Changing the frame rate setting (or any other setting) doesn't seem to make a difference. The segments reappear as soon as I click back out of another page.
Screencast_20241214_213813.webm
Operating System: Arch Linux KDE Plasma Version: 6.2.4 KDE Frameworks Version: 6.9.0 Qt Version: 6.8.1 Kernel Version: 6.12.4-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 7800X3D 8-Core Processor Memory: 61.9 GiB of RAM Graphics Processor: AMD Radeon RX 6600 XT Manufacturer: ASUS
What is happening here is that there's 2 canvases on top of each other and for some reason their content gets wiped. I'm guessing the canvas context is getting lost: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/contextlost_event
I don't know why that would be happening, but it would be good to confirm it. We can probably try to rerender the content if this happens.
Same issue on Pop!_OS 22.04 LTS with X11
- AMD Ryzen 7 5700U with Radeon Graphics
- 16 GB RAM
- GNOME 42.9
- GTK 3.24.33
Let me know if any other info would help
So I was able to figure out that forcing layout to redraw by changing its width by a pixel and setting it back worked for me. I know this is a band-aid solution but hopefully this helps give more information about the problem. I did a bit of testing to ensure it redrew everywhere necessary but it still occasionally messes up and the pixel shift is visible.
In the video I first show what the provided build looks like and then I demonstrate that my build works (mostly) fine
https://github.com/user-attachments/assets/66fcac38-45c4-4cf0-adac-1750cf68ae9e
You can see where redraws were needed under src/ui/LiveSplit.tsx and src/ui/LayoutEditor.tsx everywhere where I called the forceResize method. https://github.com/SaveThePolarBearz/LiveSplitOne
Yeah so resizing it is expected to work around the problem, as that forces the entire layout to be redrawn. In most frames however the intention is that we don't redraw the content, which seems to work just fine everywhere except with WebKit on Linux. If it's the context lost event, then we can listen to it, but I would need someone to confirm that.
Hey, I might be doing something wrong or it's not the "contextlost" event, but I cannot get the canvas to log anything. First I get the reference to the (hopefully correct canvas) via the graphics tab:
Then I add the event listener to the canvas:
$1.canvas.addEventListener("contextlost", (event) => { console.log(event); });
Then I reproduce the error but do not get any logging:
Even when I use the function monitorEvents($1); I do not get any logging from the canvas at all. Not even mouse events.
If you have any idea what I might be doing wrong I can debug further.
My System, should it help: Operating System: EndeavourOS KDE Plasma Version: 6.4.2 KDE Frameworks Version: 6.15.0 Qt Version: 6.9.1 Kernel Version: 6.15.5-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor Memory: 32 GiB of RAM (31,3 GiB usable) Graphics Processor: AMD Radeon RX 9070 XT System Version: 2.0
I debugged this a while ago and it's indeed not the contextlost event and instead a bug in WebKitGTK where it apparently doesn't track the dirty regions of the window properly.
Segments actually disappear a lot. Along with the timer. For simple things like opening the settings window.
Ubuntu 24.04.2 LTS with GNOME 48 on X11