Closed Bug 1802802 Opened 2 years ago Closed 2 years ago

steamos gamemode opens flatpak firefox in x11 mode

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 107
x86_64
Linux
defect

Tracking

()

RESOLVED MOVED

People

(Reporter: monkeyboyted, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Attached file firefox-steamos-about-support (deleted) β€”

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0

Steps to reproduce:

System: SteamOS 3.4 Beta - November 11, 2022 - steam deck

Create a custom non steam application with these settings below.

command: /usr/bin/flatpak
start in: $HOME
extra arguments: run --socket=wayland --env=MOZ_ENABLE_WAYLAND=1 --branch=stable --arch=x86_64 --command=firefox org.mozilla.firefox --window-size 1920,1200

https://github.com/Plagman/gamescope
https://steamcommunity.com/app/1675200/discussions/0/5568165891217929856/

Actual results:

The about support shows x11.

Expected results:

--socket=wayland and --env=MOZ_ENABLE_WAYLAND=1 should had enable wayland when launch in gamemode aka gamescope.

I used the flathub version of firefox.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

I think it more a setting environment and build issue. The issue might be non obvious user error. I do not know.

https://bugzilla.mozilla.org/show_bug.cgi?id=1720497#c7

If WAYLAND_DISPLAY is set but DISPLAY is not, we have every reason
to assume that we are in a Wayland-only session. Enable the Wayland
backend unconditionally in this case.

Note: We do not bother to further sanity check the content of the env
variables as these can be considered client setup bugs.

Hmmm

setting WAYLAND_DISPLAY=wayland-0 changes the display protocol to Xwayland.

https://phabricator.services.mozilla.com/differential/changeset/?ref=3655131

if defined(MOZ_WAYLAND)
bool IsWaylandEnabled() {
const char* waylandDisplay = PR_GetEnv("WAYLAND_DISPLAY");
if (!waylandDisplay) {
return false;
}

// MOZ_ENABLE_WAYLAND is our primary Wayland on/off switch.
const char* waylandPref = PR_GetEnv("MOZ_ENABLE_WAYLAND");
bool enableWayland = (waylandPref && *waylandPref);

hmmm

I need to check whether setting XDG_SESSION_TYPE will work

https://github.com/Plagman/gamescope/commit/98d61844d81f0ef39358c6336eed477054c4c320

Firefox ignores the variable. Nevermind. I didn't bother testing. I checked the changelog withing 49a6125392f5

Blocks: flatpak
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

https://github.com/Plagman/gamescope

It's getting game frames through Wayland by way of Xwayland

game is running in its own personal Xwayland sandbox desktop

It also runs on top of a regular desktop, the 'nested' usecase steamcompmgr didn't support.

Does SteamDeck / gamescope even support Wayland clients other than Xwayland? Have you been able to launch other apps in Wayland mode?
Desktop mode seems to be KDE X11.

No longer blocks: flatpak

I believe firefox wayland run in kwin wayland gamescope works.

command: dbus-run-session

args: LD_PRELOAD="" ...... WAYLAND_DISPLAY=wayland-0 XDG_SESSION_TYPE=wayland startplasma-wayland ......

run in: $HOME

Steam OS 3.4

Hi Darkspirit,

The gamescope situation confuses me. You can nest an entire wayland compositor into gamescope and it works like shown above. However, gamescope may not allow clients run in wayland mode.

Either way, firefox within gamescope have lots of other bugs even if wayland mode is not enabled. I was wondering wayland mode fixes it but I could not enable it either.

Thanks for testing!
What other bugs does Firefox suffer from within gamescope? (Apart from bug 1787939.)
Ideally please only test https://nightly.mozilla.org.
Can some of those problems be fixed by setting gfx.webrender.software to true on about:config and restarting Nightly?

Hi Darkspirit,

gfx.webrender.software does next to nothing. Notification like asking for permissions causes the web browser to lose focus. Overall, the experience is pretty lacking within gamemode. The common workaround is to use it in desktop mode.

I trying to figure out how to grab the logs within gamemode. I will think about it.

I am testing this configuration with firefox nightly and the browser does open in wayland mode in a nested kwin window manager. However, the window management awkwardness and steamos does not play well with another instance of kwin.

Nested Kwin mode handles the context menu fine. However, gestures does not seem to be recognized.

Target: env
Start in: $HOME
Launch Options: XDG_SESSION_TYPE=wayland MOZ_ENABLE_WAYLAND=1 dbus-run-session kwin_wayland --no-lockscreen --height 800 --width 1280 $HOME/bin/firefox/firefox

Blocks: flatpak
Priority: -- → P3

I tested this gamescope commit 9600bbaadf9c52a13c9a1ea805ae656f875786e8 and firefox runs on wayland.

Tested on Opensuse Tumbleweed Gnome.

 MOZ_ENABLE_WAYLAND=1 ./build/src/gamescope -- env WAYLAND_DISPLAY='wayland-0' firefox

How do I close the bug as resolved upstream?

Do I have to wait until the feature filters down to steam os beta?

(In reply to monkeyboyted from comment #20)

Do I have to wait until the feature filters down to steam os beta?

No need to wait, closing.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → MOVED

./build/src/gamescope --expose-wayland -- firefox

Wrong start up flags and variables. A gamescope dev said WAYLAND_DISPLAY='wayland-0' uses the host desktop compositor.

Expose wayland flags exposes gamescope. The newest build still works.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: