Opened 18 months ago

Last modified 10 months ago

#6649 new defect

Can't move cursor through the entire screen on Linux with GNOME and Wayland

Reported by: Agon Owned by: Vladislav Belov
Priority: Should Have Milestone: Alpha 27
Component: UI – Game setup Keywords: cursor unable click fedora dnf
Cc: Agon Patch: Phab:D4974

Description (last modified by Stan)

I have installed the game on my fedora machine using dnf install 0ad

On the opening screen, I could only move my cursor over a small area.

E.g. I could click to enable feedback, but could not click on the left panel, on "Learn to play", all the way down to "Donate".

Available area for cursor In the image, the blue area is the area in which I can move the mouse cursor, I can't reach anything outside of it.

I have reinstalled 0ad using the flatpak on registry.fedoraproject.org and this works alright.

Attachments (1)

0ad-cursor-bug.jpg (81.0 KB ) - added by Agon 18 months ago.
Available area for cursor

Download all attachments as: .zip

Change History (21)

by Agon, 18 months ago

Attachment: 0ad-cursor-bug.jpg added

Available area for cursor

comment:1 by Stan, 17 months ago

Hey could you upload the logs ? See GameDataPaths and ReportingErrors. It looks like a desktop manager issue. Has it been reported to Fedora too?

comment:2 by Stan, 17 months ago

Milestone: Alpha 27

comment:3 by Vladislav Belov, 17 months ago

If you're using Wayland could you add the borderless.fullscreen = "false" line into your user.cfg file (you might find path to it here: GameDataPaths#Linux)? Also does the issue happen in a window mode?

Last edited 17 months ago by Vladislav Belov (previous) (diff)

comment:4 by Marc Doughty, 17 months ago

I get the same thing on Ubuntu 22.04 and 22.10.

To reproduce:

  • Use the package from the repos, not the snap.
  • Seems to happen only on HiDPI displays in fullscreen. I experience it on a 2000x3000 and a 4K display, with fractional scaling set to 1.75 and 1.25, respectively.
  • Start 0ad with Wayland: '#SDL_VIDEODRIVER=wayland 0ad'

comment:5 by Stan, 17 months ago

What if you set highdpi = true in the options ?

comment:6 by Marc Doughty, 17 months ago

I tried setting highdpi = "true" and it still limited me. Then I noticed that if I broke out of the app by switching to another and then back (I was trying to get screenshots for this), I could access the whole screen properly. I'm using GNOME 4x & mutter, not sure if that plays into this at all.

comment:7 by Vladislav Belov, 15 months ago

Another random idea (requires compiling). Replace the following line in VideoMode.cpp:

m_WindowedX = m_WindowedY = SDL_WINDOWPOS_CENTERED_DISPLAY(m_ConfigDisplay);

By the following block:

if (fullscreen)
    m_WindowedX = m_WindowedY = SDL_WINDOWPOS_UNDEFINED_DISPLAY(m_ConfigDisplay);
else
    m_WindowedX = m_WindowedY = SDL_WINDOWPOS_CENTERED_DISPLAY(m_ConfigDisplay);

comment:8 by phosit, 14 months ago

I wasn't able to reproduce with:

  • on a 4K TV monitor (2 monitor setup)
  • scaling set to 1,25
  • α26 and svn
  • with SDL_VIDEODRIVER=wayland
  • I use sway not GNOME
Last edited 14 months ago by phosit (previous) (diff)

comment:9 by Stan, 14 months ago

I also tried with A26 on a Fedora 37 VM and could not reproduce. I tried the system scaling to 200% but not change, maybe it's fractional scaling? I don't know how to enable that in Fedora though.

comment:10 by Stan, 14 months ago

Description: modified (diff)

Fix image.

in reply to:  9 comment:11 by phosit, 14 months ago

Stan: did you use GNOME? did you use wayland?

comment:12 by Stan, 13 months ago

Sorry if that wasn't clear, I use the default which is GNOME + Wayland.

comment:13 by Vladislav Belov, 13 months ago

Patch: Phab:D4974

I was able to reproduce it on Ubuntu 22.04, Ubuntu 22.10, Fedora 37 and Fedora 38 Beta with enabled Wayland SDL backend via SDL_VIDEODRIVER=wayland. It's reproducible even for an SDL sample, calling SDL_SetWindowGrab(window, SDL_TRUE) on a start makes it even more noticeable.

I think (I haven't written a pure Wayland sample yet) the problem is on the GNOME side (mutter). Particularly the confinement region is outdated for some reason until some event happened (for example window activation, it's enough to switch to another window and back without moving/resizing).

I've superficially checked SDL code and it seems it doesn't specify the confinement region if we don't call SDL_SetWindowMouseRect (nullptr for confine_pointer region). So the WM should calculate the region by itself which doesn't happen properly.

Also the bug might be not reproducible on a VM (at least with default settings). As the mouse capturing might be denied by its host.

Refs #545

Last edited 13 months ago by Vladislav Belov (previous) (diff)

comment:14 by Vladislav Belov, 13 months ago

Owner: set to Vladislav Belov

comment:15 by Vladislav Belov, 13 months ago

Last edited 13 months ago by Vladislav Belov (previous) (diff)

comment:16 by Vladislav Belov, 13 months ago

In 27603:

Adds an option to disable mouse grab in fullscreen.

Refs #6649
Refs #545

Differential Revision: https://code.wildfiregames.com/D4974

comment:17 by Vladislav Belov, 13 months ago

Milestone: Alpha 27Alpha 28
Priority: Release BlockerShould Have

Do not close the ticket until the GNOME one is resolved.

comment:18 by Vladislav Belov, 13 months ago

Summary: Can't move cursor through the entire screen in linux fedora dnf installationCan't move cursor through the entire screen on Linux with GNOME

comment:19 by Stan, 13 months ago

Summary: Can't move cursor through the entire screen on Linux with GNOMECan't move cursor through the entire screen on Linux with GNOME and Wayland

comment:20 by Stan, 10 months ago

Milestone: Alpha 28Alpha 27

Push back

Note: See TracTickets for help on using tickets.