Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Support for Wayland clients #543

Open
TheComputerGuy96 opened this issue Jul 5, 2022 · 10 comments
Open

[Feature request] Support for Wayland clients #543

TheComputerGuy96 opened this issue Jul 5, 2022 · 10 comments

Comments

@TheComputerGuy96
Copy link

TheComputerGuy96 commented Jul 5, 2022

As the title says, Gamescope needs to add support for Wayland clients

For example If you try to run a SDL2 game with SDL_VIDEODRIVER=wayland under gamescope, then gamescope won't touch it at all

Running it with SDL_VIDEODRIVER=x11 makes gamescope actually work with it, but I don't like running an outdated display server if a game can natively run on Wayland

I wonder how hard this would be to achieve because you use wlroots (I've tried running nested sway with the output scale set to below 1 for one of gamescope's nice features (aka downsampling) and it kinda works but it's a bit of a mess with having to resize a microscopic terminal and the mouse spins in circles in the few games I tried)

Edit: Apparently this topic was mentioned in #164, but it wasn't a feature request

@TiZ-HugLife
Copy link

TiZ-HugLife commented Jul 11, 2022

This sort of thing is why you couldn't run OBS Studio in game mode by default. It is detected as a Wayland session, but the fact that Gamescope doesn't actually support Wayland clients causes it to just immediately crash.

Either gamescope should support Wayland clients, or it should not advertise itself as a Wayland session.

EDIT: As to the OP's concerns, it is worth noting that you're not actually running Xorg when you set SDL_VIDEODRIVER=x11. All applications go through XWayland. But then I have to wonder... why do any of the applications with backends that support Wayland work at all right now, if Gamescope is detected as Wayland without actually supporting Wayland clients?

@Joshua-Ashton
Copy link
Collaborator

We do not advertise support for xdg shell.

@TiZ-HugLife
Copy link

I'm presuming XDG Shell is what most other applications check to determine if they are running in a Wayland compositor. Then, in that case, do you think that Qt 6--the toolkit that OBS Studio is using--is doing something wrong?

@Joshua-Ashton
Copy link
Collaborator

Joshua-Ashton commented Jul 11, 2022

Yes, Qt6 should check if xdg-shell is supported before trying to use it, and fallback to X if not.

@Joshua-Ashton
Copy link
Collaborator

We don't have this problem with other Qt apps though, so, strange... maybe its something OBS is doing instead? Have we determined its Qt and not say, wayland video capture plugin, etc?

@TiZ-HugLife
Copy link

Potentially? It seems like OBS team is also unsure whether it's them or Qt. I'm pretty sure "Wayland video capture" is just Pipewire--and as far as I know, Pipewire-based video capture should also work on X11 anyways--but it doesn't, not on KDE Neon nor on SteamOS.

@flibitijibibo
Copy link

Dragging in a loose end from #668: Whenever Wayland clients are fully supported, that should include support for text-input-v3 so that the on-screen keyboard can continue to work, as it now does with SDL's x11 driver:

libsdl-org/SDL@c4b9f62

(FWIW, SDL supports systems without xdg-shell, it just happens to be that xdg-shell gives us a lot of useful stuff, but gamescope won't care about most of this. I encourage anyone focused on this task to look at SDL's Wayland folder to evaluate the tradeoffs: https://github.com/libsdl-org/SDL/tree/main/src/video/wayland )

@orowith2os
Copy link

I also recently found a use case for supporting Wayland clients.

I've been tinkering with Wine patched with Wayland support, and GNOME freaks out when some games are running with it, showing the window in a weird way.

orowith2os/wine#1 (comment)

@eszlari
Copy link

eszlari commented Apr 13, 2023

Support for xdg-shell was added: #759

@serebit
Copy link

serebit commented Oct 17, 2023

Qt6 applications don't appear to work correctly with --expose-wayland. I've tested both waycheck and zapzap, and both display the same behavior - window decorations aren't hidden, and input fails to register properly. Current release version doesn't allow input at all, just toggles between focused and unfocused on keypress. Current master is an improvement - button presses do seem to do something - but still entirely unusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants