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

session-desktop: fix wayland flags in package #245947

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

9p4
Copy link
Contributor

@9p4 9p4 commented Jul 28, 2023

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

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Comment on lines +38 to +40
install -Dm 644 ${appimageContents}/${pname}.desktop -t $out/share/applications/

substituteInPlace $out/share/applications/${pname}.desktop --replace "AppRun" "${pname}"
Copy link
Contributor

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 :)

Copy link
Contributor Author

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.

Comment on lines +42 to +43
wrapProgram $out/bin/${pname} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations,UseOzonePlatform}}"
Copy link
Contributor

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

Copy link
Contributor Author

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))

electron/electron#34937

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.

@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants