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

Desktop: Fixes #9045: Ubuntu: Fix window sometimes doesn't appear on startup #9561

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Dec 19, 2023

Explanation

  • Electron replaces XDG_CURRENT_DESKTOP with Unity on ubuntu:GNOME, but also stores the original XDG_CURRENT_DESKTOP in ORIGINAL_XDG_CURRENT_DESKTOP.

This change causes shim.isGNOME to also check ORIGINAL_XDG_CURRENT_DESKTOP.

Fixes #9045.

Testing

  1. Launch the application using npx electron . (start in release mode)
    • Do not launch from the terminal in VSCode (VSCode is an electron app, and thus also modifies XDG_CURRENT_DESKTOP).
  2. Verify that the application window is visible
  3. Repeat steps 1 and 2
  4. Run shim.isGNOME() in the development tools.

This has been tested on Ubuntu 23.10.

Notes

This may apply to other systems/desktop environments:

In /lib/browser/init.ts,

// Workaround for electron/electron#5050 and electron/electron#9046
process.env.ORIGINAL_XDG_CURRENT_DESKTOP = process.env.XDG_CURRENT_DESKTOP;
if (currentPlatformSupportsAppIndicator()) {
  process.env.XDG_CURRENT_DESKTOP = 'Unity';
}

Electron replaces XDG_CURRENT_DESKTOP with Unity on ubuntu:GNOME, but
also stores the original XDG_CURRENT_DESKTOP in
ORIGINAL_XDG_CURRENT_DESKTOP.

This change causes shim.isGNOME to also check
ORIGINAL_XDG_CURRENT_DESKTOP.
@laurent22 laurent22 merged commit 3b4eb16 into laurent22:dev Dec 20, 2023
10 checks passed
personalizedrefrigerator added a commit to personalizedrefrigerator/joplin that referenced this pull request Dec 27, 2023
laurent22 pushed a commit that referenced this pull request Jan 4, 2024
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

Successfully merging this pull request may close these issues.

Ubuntu Linux: Window sometimes still doesn't appear on startup
2 participants