Framerate limiting seems very broken in Wayland backend on Gnome session
Tested with tag 3.15.0 but present in every 3.14.x I tested as well. -o doesn't function at all, which I'm guessing is expected behavior under Wayland since there isn't a mechanism for the gamescope window to know it's out of focus. gamescope -r 30 -- vkcube does at least try to limit the framerate, but Mangoapp indicates an average framerate of 40fps with a very spiky frametime graph. When moving the cursor within the window, the framerate drops to 20fps with a flat frametime graph. With --backend sdl framerate limiting with -r and with -o work as expected. Additionally, gamescopectl debug_set_fps_limit 30 produces a proper 30fps limit with flat frametimes under the Wayland backend.
A possible clue is this line from the log:
[gamescope] [Info] xdg_backend: Changed refresh to: 60.000hz
Which doesn't appear when using the SDL backend or when using gamescopectl to set the framerate limit while running the Wayland backend.
Additionally, --framerate-limit simply hasn't worked in quite awhile, but I'm not sure whether that is intentional. Both gamescopectl debug_set_fps_limit and -r / -o seem to work in the manner gamescope --help indicates --framerate-limit is supposed to, eg: on a 60hz monitor gamescope -r 50 -- vkcube runs at 60fps, while gamescope -r 40 -- vkcube runs at 30fps. Is this the expected behavior? Has --framerate-limit been deprecated?
Tested on Ubuntu 24.04 with Gnome 46.2 and mesa 24.2.0~kisak2~n.