linuxmint / cinnamon-session

The Cinnamon session manager
GNU General Public License v2.0
27 stars 36 forks source link

util: Blacklist some session-specific variables #141

Closed leigh123linux closed 3 years ago

leigh123linux commented 3 years ago

Based on: https://github.com/GNOME/gnome-session/commit/646b9bc0584d02033ab9600c39b77d6f99bfc4a6 https://github.com/GNOME/gnome-session/commit/9d8b0709

Fixes https://github.com/linuxmint/cinnamon-session/issues/140

smcv commented 3 years ago

Thanks, this looks good to me. While you're here you might also want to sync up with later changes to the corresponding file in gnome-session, which fixes various bugs related to this code:

Those all seem like good fixes to have.

ItzSwirlz commented 3 years ago

Yeah, to be fair it's been a while since we've checked upstream for anything that may be useful for -session. Thanks @smcv :)

ItzSwirlz commented 3 years ago

I'd love to implement https://github.com/GNOME/gnome-session/commit/b7b24627 but we aren't sure what the idea with Wayland is.. I was asked if we would follow the proper XDG_DECORATION in muffin and stuff. Does any of the devs know what we want to do with Wayland or are we sticking with Xorg?

smcv commented 3 years ago

GNOME can be run in either X11-only or Wayland mode (they appear as separate session types in gdm), and its handling of those environment variables is the same for both modes - so I expect that Cinnamon should probably do the same, regardless of whether Cinnamon is permanently X11-only, currently X11-only with plans to adopt Wayland in future (similar to old GNOME versions), or already supports Wayland (similar to current GNOME).

In an X11-only session, if a previous session (maybe GNOME or another desktop) has pushed WAYLAND_DISPLAY and WAYLAND_SOCKET into the systemd environment, you'll want to remove them from the environment so that they don't confuse apps into thinking they can still use Wayland. In a Wayland session, you'd want to remove those variables from the environment and replace them with your own values for them (if any). I think the gnome-session code does the right thing for both of those cases.

smcv commented 3 years ago

If Cinnamon/muffin becomes a Wayland compositor in future, then it's up to the compositor developers whether it prefers client-side decoration (like Weston and mutter), server-side decoration (like traditional X11), or some combination of the two.

I don't think getting the environment variable handling right has any impact on that decision.

ItzSwirlz commented 3 years ago

Implemented the commits above in https://github.com/leigh123linux/cinnamon-session/pull/1 except for https://github.com/GNOME/gnome-session/commit/60e619b8 because we need to add a few more commits to catch up to it.

mtwebster commented 3 years ago

@ItzSwirlz please open a new pr for that other stuff. Also please be sure all of that even applies to us. For instance, CINNAMON_SHELL_SESSION_MODE isn't a thing - I believe that had to do with gnome's short-lived 'classic mode'.