Repository navigation
fix: set XDG_CURRENT_DESKTOP env var back to original value before invoking xdg utils - #45310
Conversation
|
💖 Thanks for opening this pull request! 💖 Semantic PR titlesWe use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Commit signingThis repo enforces commit signatures for all incoming PRs. PR tipsThings that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
|
some breadcrumbs: looks like the @esimkowitz would this PR make |
|
No, because I'm not actually updating the env var for the Electron process (at least I don't think I am), I'm just updating it when calling out to XDG for opening links/paths externally. If a new process is spawned via Node, it would need to set this variable itself using the |
|
It may make sense, though, if the updated XDG value is only being used for the app indicators, to limit its application to only system calls that update the app indicators. I wonder, too, if this is an outdated workaround. It may be worth auditing current desktop environment capabilities to see if this is still needed. Update: It seems like the Chromium codebase handles this behavior, I don't have the domain knowledge to say whether this can be limited beyond the env var that Chromium picks up. |
|
Looks like one of the builds failed, it seems like a transient error. @ckerr can you restart the failing job? |
XDG_CURRENT_DESKTOP env var back to original value before invoking xdg utils
|
@samuelmaddock can you rerun the build for this? I believe the Windows ARM build failure was transient |
|
@samuelmaddock @ckerr checking as this has been dormant for a month, can you rerun the checks for this? I believe they should all pass and the failures were transient. |
|
@esimkowitz could you please rebase this? |
|
@ckerr I've rebased my PR to the latest main, can you re-review when you get a chance? |
|
Hi @ckerr @codebytere, the backport checks are failing for this, it seems like it's triggering for an unchanged file, can you help me understand what's causing this? I'd like to get this merged soon as it's been open for 2 months and I keep having to rebase it... |
|
Hi @ckerr @codebytere can you help me understand what is blocking this? This PR is getting pretty old and I would like to get this checked in... |
There was a problem hiding this comment.
Requesting one small change 😄
With the original issues about Pantheon for reference, I also took the time to go through all the uses of the XDG_CURRENT_DESKTOP env var in Chromium. I only found one bit of code that could have different behavior, but we don't use that Chromium code. So, I believe this change to be reasonably safe.
As a separate follow-up to this PR we should look at removing the XDG_CURRENT_DESKTOP workaround entirely imo.
P.S. Sorry about the long tail on landing this change! I'll keep my eye on this one.
|
I have automatically backported this PR to "33-x-y", please check out #46787 |
|
I have automatically backported this PR to "36-x-y", please check out #46788 |
|
I have automatically backported this PR to "35-x-y", please check out #46789 |
This comment was marked as outdated.
This comment was marked as outdated.
|
I have automatically backported this PR to "34-x-y", please check out #46791 |
…invoking xdg utils (#46787) fix: set `XDG_CURRENT_DESKTOP` env var back to original value before invoking xdg utils (#45310) * Fix XDG_CURRENT_DESKTOP before invoking XDGUtil * apply suggestion * use existing XDG_CURRENT_DESKTOP const Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Evan Simkowitz <[email protected]>
…invoking xdg utils (#46791) fix: set `XDG_CURRENT_DESKTOP` env var back to original value before invoking xdg utils (#45310) * Fix XDG_CURRENT_DESKTOP before invoking XDGUtil * apply suggestion * use existing XDG_CURRENT_DESKTOP const Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Evan Simkowitz <[email protected]>
…invoking xdg utils (#46789) fix: set `XDG_CURRENT_DESKTOP` env var back to original value before invoking xdg utils (#45310) * Fix XDG_CURRENT_DESKTOP before invoking XDGUtil * apply suggestion * use existing XDG_CURRENT_DESKTOP const Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Evan Simkowitz <[email protected]>
…invoking xdg utils (#46788) fix: set `XDG_CURRENT_DESKTOP` env var back to original value before invoking xdg utils (#45310) * Fix XDG_CURRENT_DESKTOP before invoking XDGUtil * apply suggestion * use existing XDG_CURRENT_DESKTOP const Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Evan Simkowitz <[email protected]>
…invoking xdg utils (electron#45310) * Fix XDG_CURRENT_DESKTOP before invoking XDGUtil * apply suggestion * use existing XDG_CURRENT_DESKTOP const
Description of Change
This PR corrects the XDG_CURRENT_DESKTOP environment variable, with the goal of ensuring that
electron.shell.openExternalandelectron.shell.openPathactually honor the user-defined system defaults on Linux.Currently, this variable is overridden by Electron to
Unity(the original value is preserved in theORIGINAL_XDG_CURRENT_DESKTOPvariable). This was introduced by #23512 to workaround #5050 and #9046, however it causesxdg-openand similar utilities whichelectron.shellrelies on to no longer honor the system defaults if a user is running the GNOME desktop environment (I have only tested this on GNOME, but I assume this is valid for all non-Unity environments).This change preserves the overridden environment variable value for use by Electron and Chromium. When a call needs to be made to the XDG utilities, the original value will be dynamically injected back into the environment variable set that is sent to the spawned XDG process.
cc @clavin @mlaurencin
fixes #45129
Checklist
Release Notes
Notes: Fixed
electron.shell.openExternalandelectron.shell.openPathto honor user-defined system defaults on Linux