LiveSplitOne icon indicating copy to clipboard operation
LiveSplitOne copied to clipboard

(Linux) Segments disappear as soon as the timer starts

Open MirandaStreeter opened this issue 11 months ago • 4 comments

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

MirandaStreeter avatar Dec 15 '24 05:12 MirandaStreeter

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.

CryZe avatar Feb 12 '25 16:02 CryZe

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

SaveThePolarBearz avatar Mar 09 '25 03:03 SaveThePolarBearz

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

SaveThePolarBearz avatar Mar 11 '25 21:03 SaveThePolarBearz

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.

CryZe avatar Mar 14 '25 14:03 CryZe

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:

Image

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:

Image

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

pi3n4t avatar Jul 09 '25 00:07 pi3n4t

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.

CryZe avatar Jul 09 '25 06:07 CryZe

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

cD1rtX3 avatar Aug 21 '25 11:08 cD1rtX3