SFML community forums

Help => Window => Topic started by: Luca on October 25, 2023, 12:53:12 am

Title: Issue with setMouseCursorVisible & setMouseCursorGrabbed on Linux
Post by: Luca on October 25, 2023, 12:53:12 am
Hi there. I'm new on Linux, but have some pleasant experiences with SFML. I have some problems with mouse commands:
- setMouseCursorVisible works
- setMouseCursorGrabbed works
BUT if they used together, sometimes window margins are wrong for grabbing (little shift down and right), or grubbing happens only after first click in window and cursor invisible at window tilebar too

- sf::Mouse::setPosition does nothing AND frees mouse from previous two states. Looping "setMouseCursorGrabbed" changes nothing, looping "setMouseCursorVisible" creates flickering

It's pure Debian, GNOME, SFML installed via apt. What is wrong and what can I do? Maybe I can do some tests or give you more info?
Title: Re: Issue with setMouseCursorVisible & setMouseCursorGrabbed on Linux
Post by: eXpl0it3r on October 25, 2023, 09:28:41 am
I split it from the other thread (https://en.sfml-dev.org/forums/index.php?topic=29196.0) as it's pretty much unrelated.

Do you use Wayland?
Title: Re: Issue with setting Mouse Position on Arch Linux
Post by: Luca on October 25, 2023, 11:58:08 am
I've changed my session type from gnome to gnome Xorg and problem resolved. Seems like it's the exact same issue.
Title: Re: Issue with setMouseCursorVisible & setMouseCursorGrabbed on Linux
Post by: Luca on October 25, 2023, 12:00:44 pm
Sorry for second answer in the previous tread. It seems that problem resolved the exact same way: I've changed my session type from gnome to gnome Xorg and everything works good. And yes, by default GNOME uses Wayland.
Title: Re: Issue with setMouseCursorVisible & setMouseCursorGrabbed on Linux
Post by: eXpl0it3r on October 25, 2023, 12:29:05 pm
Okay, so it was related, but not very clear from the message. As non-Linux user, I wouldn't know that GNOME switch to default for Wayland :D
Title: Re: Issue with setMouseCursorVisible & setMouseCursorGrabbed on Linux
Post by: eXpl0it3r on October 25, 2023, 12:34:44 pm
Can you try to build SFML 2.6.0 from source?

Maybe there has already been a fix for it?

For now, I've created an issue to track it: https://github.com/SFML/SFML/issues/2750