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

--ozone-platform-hint flag not working #664

Closed
red5h4d0w opened this issue Feb 23, 2022 · 8 comments
Closed

--ozone-platform-hint flag not working #664

red5h4d0w opened this issue Feb 23, 2022 · 8 comments
Labels
upstream-dependencies wayland Tracking issues related to supporting Wayland display server

Comments

@red5h4d0w
Copy link

red5h4d0w commented Feb 23, 2022

Describe the bug

It seems that running github-desktop --ozone-platform-hint=auto doesn't lauch on wayland session on my installation, but rather on XWayland.

Version & OS

Arch official Repo 2.9.9RC1
.appimage 2.9.9RC2
on
OS: EndeavourOS
DE: Gnome
WM: Gnome-mutter
Machine: Framework DIY Edition i7-1165 Mainboard

Steps to reproduce the behavior

  1. Open a command prompt
  2. run github-desktop --ozone-platform-hint=auto

Expected behavior

Should launch in wayland mode.

Actual behavior

Launches in XWayland mode.
Confirmed using xwininfo.

Logs

Output when the command is run

(github-desktop:41268): Gtk-WARNING **: 12:27:16.735: Theme parsing error: gtk.css:13199:20: Not a valid image

(github-desktop:41268): Gtk-WARNING **: 12:27:16.735: Theme parsing error: gtk.css:13210:20: Not a valid image

(github-desktop:41268): Gtk-WARNING **: 12:27:16.735: Theme parsing error: gtk.css:13221:20: Not a valid image

(github-desktop:41268): Gtk-WARNING **: 12:27:16.735: Theme parsing error: gtk.css:13233:20: Not a valid image

(github-desktop:41268): Gtk-WARNING **: 12:27:16.735: Theme parsing error: gtk.css:14437:17: Not using units is deprecated. Assuming 'px'.

(github-desktop:41268): Gtk-WARNING **: 12:27:16.735: Theme parsing error: gtk.css:14554:23: Expected semicolon

(github-desktop:41268): Gtk-WARNING **: 12:27:16.736: Theme parsing error: gtk.css:15847:28: Junk at end of value for background-color
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[41301:0223/122716.822810:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[41301:0223/122720.860977:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
@shiftkey
Copy link
Owner

It seems that running github-desktop --ozone-platform-hint

@red5h4d0w can you please fill this out further and indicate what you're trying to achieve? We've been talking about this a bit over in #591 and some users have got fractional scaling work with this set of parameters:

--enable-features=UseOzonePlatform --ozone-platform=wayland

@red5h4d0w
Copy link
Author

I've edited the missing part of the sentence.
Yes that works perfectly, but the usefulness of the flag mentioned is that it would make it possible to build the app such that it always uses this flag that chooses the ozone platform according to what the users actually needs instead of having to edit their .desktop files or always running the environment specific flag

@shiftkey
Copy link
Owner

Yes that works perfectly, but the usefulness of the flag mentioned is that it would make it possible to build the app such that it always uses this flag that chooses the ozone platform according to what the users actually needs instead of having to edit their .desktop files or always running the environment specific flag

I'm not familiar enough with this new platform support or how stable things are, so I'm reluctant to try and force this by default especially since this is our first release where this is working. Can you talk to the workarounds you're doing to the .desktop file so I can better understand the workarounds you're doing at the moment?

@red5h4d0w
Copy link
Author

red5h4d0w commented Feb 24, 2022

I'd like the flag ozone-platform-hint=auto to be there by default, but that's another topic, at present this flag doesn't even work. For this issue, I'd like the flag to work properly.
It's supposed to choose what session to use (Wayland/X11) based on what the user has (Wayland/X11).

I'm editing the .desktop to make the desktop icon execute github-desktop --enable-features=WaylandWindowDecorations --ozone-platform=wayland instead of github-desktop, but the ideal would be to be able to use github-desktop --ozone-platform-hint=auto (because its platform agnostic and would fit users that use both wayland and X11 environnements)

@shiftkey shiftkey added upstream-dependencies wayland Tracking issues related to supporting Wayland display server labels Apr 3, 2022
@shiftkey
Copy link
Owner

shiftkey commented Aug 2, 2022

An idea that might help unblock further experimentation here could be to allow us to bake some settings behind an environment variable. Does this approach appeal to anyone, aside from the caveats that the environment variables need to be set outside of the shell environment to be picked up by the OS app launcher?

diff --git a/app/src/main-process/main.ts b/app/src/main-process/main.ts
index 3c2e290ea..bff1b1f43 100644
--- a/app/src/main-process/main.ts
+++ b/app/src/main-process/main.ts
@@ -298,6 +298,14 @@ function setAsDefaultProtocolClient(protocol: string) {
   }
 }
 
+if (process.env.GITHUB_DESKTOP_EXPERIMENT_WAYLAND_SUPPORT) {
+  log.info(
+    `GITHUB_DESKTOP_EXPERIMENT_WAYLAND_SUPPORT environment variable set, setting command line flags`
+  )
+  app.commandLine.appendSwitch('enable-features', 'UseWaylandDecorations')
+  app.commandLine.appendSwitch('ozone-platform', 'wayland')
+  // ...
+}
+
 if (process.env.GITHUB_DESKTOP_DISABLE_HARDWARE_ACCELERATION) {
   log.info(
     `GITHUB_DESKTOP_DISABLE_HARDWARE_ACCELERATION environment variable set, disabling hardware acceleration`

@red5h4d0w
Copy link
Author

Since (newer) electron uses the aforementioned flag for this use case, i believe it would be better to wait till 20.0.0 (or 19.0.10) makes it to GitHub Desktop. These versions should have the upstream commit for this flag to work.

@sarim
Copy link

sarim commented Nov 13, 2022

To use UseWaylandDecorations,without mangled UI, electron version needs to be updated to at least 19.0.12. It includes the fix for mangled ui electron/electron#34955 . These bugs were introduced at 19.0.0. So please consider upgrading electron version to at least 19.0.12.

It's surprisingly fine for github-desktop 3.0.5-linux1, as it uses a older electron version.

@red5h4d0w
Copy link
Author

Just tested the newest release and this issue has been solved.
I am therefore closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream-dependencies wayland Tracking issues related to supporting Wayland display server
Projects
None yet
Development

No branches or pull requests

3 participants