AsherGlick / Burrito

An overlay tool for Guild Wars 2 that works on linux
GNU General Public License v2.0
79 stars 18 forks source link

Mouse leaving play area on multimon setup #93

Open Synthawk opened 1 year ago

Synthawk commented 1 year ago

Burrito doesn't appear to have any ability to lock the cursor in to the screen when being used. I can get it to load, show markers, everything works fantastic, but it doesn't keep the mouse in bounds. If I hold right click to look around, it's perfectly fine until I let go, then the mouse teleports to wherever it would have been if I hadn't pressed it, such as on one of the side monitors. The same goes if I try to use action camera. The game correctly locks the mouse to the center of the screen when captured when Burrito is not overlayed.

Is there any way to get Burrito to force the cursor to save as in the center of the Burrito window when left or right mouse are held? That could be a potential workaround for this.

OS: Garuda Linux (KDE Wayland) Monitor Config: 4k screen in center, 2 portrait ultrawides on sides

AsherGlick commented 1 year ago

This is strange, though I have not done any tests on Wayland so it could be a Wayland specific issue given that most of the overlay configuration is done with X11 libraries here . Burrito should not be interacting with the mouse at all. All mouse actions should be being passed through to GW2 underneath. Just to be sure can you confirm that this does not happen on GW2 when not running Burrito?

We could force the mouse to the center if Burrito had focus, but I fear if we did that then the mouse movement actions would not pass through to GW2 and you would just not be able to move.

Synthawk commented 1 year ago

You're correct, it works fine when Burrito isn't running. Under normal behavior, if I hold left or right mouse and move the mouse far right, the camera spins as expected, and when I let go of the mouse button, it appears directly in the center of the screen.

With Burrito, the mouse moves freely while it's "invisible" during this mouse look mode. If it goes out of the window, it becomes visible on another screen. If not, when I let go of the mouse button, it's in a new spot relative to wherever I moved the mouse. It's as if the pass through is causing the mouse to not lock in the center when being used for look functionality.

I also cannot click on anything in game if the settings options are up, not sure if that helps with debugging anything, as that might be completely expected. I've even tried forcing the mouse to lock in to the window with mouse warp in Lutris but that doesn't make a difference. I also can't click back in to GW2 correctly after the mouse leaves and I lose focus to another window (I use mouse focus, but turning that off made no difference). If I click in the GW2 window after it's lost focus, I can use the mouse to look around, and double click to move, but keyboard commands don't work. I have to alt tab back to GW2 in order to bring keyboard command control back to the front.

Synthawk commented 1 year ago

I've switched to using X and the issue has gone away completely, so it appears unrelated to anything else with my system, be it KDE, monitor configuration etc, and is entirely related to Wayland. Let me know if you need anything on my end to assist with debugging. It seems that under Wayland, the Guild Wars client is unable to capture the mouse within the window when it's being passed through Burrito like expected. Might be a missing feature in Wayland, or something that needs to be adjusted for. I know there are several other pieces of hardware I have that have really unexpected behavior in Wayland with no fix as of right now as the functions simply don't exist yet.

AsherGlick commented 1 year ago

For now, all support for anything other then Ubuntu Gnome on X11 is entirely community driven by folks like yourself. This is just a limitation of my own time and resources. So feel free to share information you feel is relevant to you, or to others who might find themselves in a similar situation as you did, even if it just a readme change that describes the issue in Wayland and that switching to X11 is one possible option to fix it. If you are feeling very motivated, you can include a link to a wayland bugtracker issue describing the feature it is missing, or if it is not a issue in wayland but an interaction issue, a link to a wayland API endpoint that we should be calling in the future.