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
session-desktop: fix wayland flags in package #245947
base: master
Are you sure you want to change the base?
Conversation
install -Dm 644 ${appimageContents}/${pname}.desktop -t $out/share/applications/ | ||
|
||
substituteInPlace $out/share/applications/${pname}.desktop --replace "AppRun" "${pname}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I woud like to keep the old desktop item as it feels more declarative and uses the full path. Compared to the upstream item that relies on the environment.
However I think it is a good idea to use the icons directly from the upstream and it would be nice if you could make that work with the current desktop item :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of the problem was that the desktop file referenced the application directly without the Wayland flags. I'll look into making the desktop file work with the wrapper, but since the flags rely on Bash variable expansion to function, I can't just embed the flag code in the desktop file.
Additionally, I do not think it's possible for the package to reference itself (correct me if I'm wrong) for the desktop file to refer to the wrapper script.
Finally, I think it's fine for the desktop file to only work if the package is installed into the path. To keep the scripts simple, I think it's fine to assume that the .desktop file will only be used if the package is in the path.
wrapProgram $out/bin/${pname} \ | ||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations,UseOzonePlatform}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the old one ran fine for me on wayland, so lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like ozone-platform-hint
was only added to Electron versions 18+ (and not on version 17.4.10 which is what Session is using (shame))
I could not get native Wayland to work with the hint flag, but it works with the explicit flag. I wonder what your environment is doing that causes this to happen.
Description of changes
Session Desktop was not launching in Wayland (and instead was launching under XWayland). This is because it is packaged with an older version of Electron that uses different flags. This pull request should fix that.
CC maintainer: @Alexnortung
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)