CuarzoSoftware / Louvre

C++ library for building Wayland compositors.
MIT License
506 stars 14 forks source link

Mouse freezes #30

Closed 2xsaiko closed 6 months ago

2xsaiko commented 7 months ago

Louvre sometimes doesn't process mouse inputs, so the cursor stays in place even though I'm moving the mouse. When it happens, it seems to stick until you stop moving it, at which point it will actually process the inputs and move the cursor. Not sure what the problem is since I haven't looked at the architecture. Looks to me like it might be getting flooded with mouse inputs events which causes it to no longer process anything else, or something like that.

ehopperdietzel commented 7 months ago

Strange, could you please provide information on the GPU hardware and driver you're using?

Additionally, does it also happen in other compositors like Weston or Sway?

Lastly, could you attempt running it with the SRM_FORCE_LEGACY_API=1 environment variable?

ehopperdietzel commented 7 months ago

I think I've discovered the problem. I was adding support for controlling vsync in SRM, and one of the things I did was try to force and retry commits using the atomic drm API in cases where it returned -EBUSY. I just tested on all my devices, and at least with nouveau, this was causing bugs, displaying an exorbitant refresh rate even with vsync enabled. In any case, I didn't have any issues with the cursor on any of my devices, but I imagine this could be causing problems with the hardware cursor plane in your case.

I pushed the changes to the "devel" branch of SRM, which at least on all my devices, solves the problem. Could you try it on yours?

Cheers

2xsaiko commented 6 months ago

It does indeed seem to be fixed with 0.5.2-1. Thanks! 🎉

Strange, could you please provide information on the GPU hardware and driver you're using?

RX 6800 XT with the amdgpu driver, Linux 6.1.71.

Additionally, does it also happen in other compositors like Weston or Sway?

Nope, other compositors including these work fine.

ehopperdietzel commented 6 months ago

Phew, thank goodness! I don't have an AMD GPU so I always ask a friend to run tests on his PC, but this time I didn't, thinking there wouldn't be any issues. Anyway, thank you very much for reporting and testing it! 😃