Bug 785918 - After gnome-classic session, gnome session looks like gnome-classic
After gnome-classic session, gnome session looks like gnome-classic
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2017-08-07 03:06 UTC by xiaoguang wang
Modified: 2017-09-11 13:32 UTC (History)
3 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
omit environment variable GNOME_SHELL_SESSION_MODE (1.71 KB, patch)
2017-08-07 06:54 UTC, xiaoguang wang
none Details | Diff | Review
session omit environment variable GNOME_SHELL_SESSION_MODE=classic (1.86 KB, patch)
2017-08-15 06:29 UTC, xiaoguang wang
none Details | Diff | Review

Description xiaoguang wang 2017-08-07 03:06:01 UTC
After logging out of a Gnome Classic session, then logging in as gnome session, desktop looks like gnome classic, there are top and bottom bars.

Steps to Reproduce:
1.Log into Gnome Classic
2.Log out of Gnome Classic
3.Immediately Log into Gnome session

The fault can't be reproduced every time, it depends on some OS or environment. I find this problem on openSUSE Tumbleweed, I can't reproduce it on Fedora 26.

There is related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1428001
Comment 1 xiaoguang wang 2017-08-07 06:16:10 UTC
When problem happened, after you logged in as gnome session, you can find the environment variable 'GNOME_SHELL_SESSION_MODE=classic', this cause gnome shell to start gnome classic desktop. Where is this environment variable from?

When problem happened, after logging out gnome classic, use loginctl to show sessions

> loginctl
   SESSION        UID USER             SEAT             TTY
        c1        474 gdm              seat0            /dev/tty7
         1       1000 test             seat0            /dev/tty2

> loginctl session-status 1 
1 - test (1000)
           Since: Fri 2017-08-04 14:58:09 CST; 2 days ago
          Leader: 2012
            Seat: seat0; vc2
             TTY: /dev/tty2
         Service: gdm-password; type x11; class user
           State: closing
            Unit: session-1.scope
                  ├─2160 /usr/bin/pulseaudio --start --log-target=syslog
                  └─2163 /usr/lib/pulse/gconf-helper

> ps aux |grep dbus-daemon
message+   806  0.0  0.2  44656  5464 ?        Ss   Aug04   0:02 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
gdm       1725  0.0  0.2  42648  4492 ?        Ss   Aug04   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
gdm       1823  0.0  0.2  42212  4156 ?        S    Aug04   0:00 /bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
test     22759  0.0  0.2  42212  4124 ?        Ss   11:28   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
test     23073  0.0  0.0   8584   824 pts/1    S+   11:30   0:00 grep --color=auto dbus-daemon

we can see process pulseaudio can't stop immediately, and user login session can't release completely. This will make user dbus-daemon can't release. The environment variable GNOME_SHELL_SESSION_MODE stores in user dbus-daemon.

When logging in as gnome session, if old user dbus-daemon exists, GDM doesn't create new user dbus-daemon and uses old, then environment variable 'GNOME_SHELL_SESSION_MODE' inherits from old user session.

I think GDM should omit 'GNOME_SHELL_SESSION_MODE' when inheriting from old dbus-daemon environment.
Comment 2 xiaoguang wang 2017-08-07 06:54:54 UTC
Created attachment 357087 [details] [review]
omit environment variable GNOME_SHELL_SESSION_MODE
Comment 3 Ray Strode [halfline] 2017-08-09 18:07:43 UTC
Thanks pushed with minor changes

   84a28ade..9bd3c5f0  master -> master
Comment 4 Ray Strode [halfline] 2017-08-14 14:00:29 UTC
I had to revert this because it broke the greeter and initial-setup.
Comment 5 Ray Strode [halfline] 2017-08-14 14:00:56 UTC
(see bug 786278 )
Comment 6 xiaoguang wang 2017-08-15 06:29:56 UTC
Created attachment 357607 [details] [review]
session omit environment variable GNOME_SHELL_SESSION_MODE=classic
Comment 7 Ray Strode [halfline] 2017-08-15 14:24:51 UTC
is this patch even needed after https://git.gnome.org/browse/gnome-session/commit/?id=97d1cf5360c0bbf213c8037918c7b14582e7791d ?
Comment 8 xiaoguang wang 2017-08-16 05:51:06 UTC
(In reply to Ray Strode [halfline] from comment #7)
> is this patch even needed after
> https://git.gnome.org/browse/gnome-session/commit/
> ?id=97d1cf5360c0bbf213c8037918c7b14582e7791d ?

I tried https://git.gnome.org/browse/gnome-session/commit/?id=97d1cf5360c0bbf213c8037918c7b14582e7791d , still has same problem. So we need this patch.
Comment 9 Ray Strode [halfline] 2017-09-08 19:28:11 UTC
Okay this should be squared away now:

To ssh://git.gnome.org/git/gdm
   95b46d9d..853e93be  master -> master

I went with a slightly different approach.
Comment 10 xiaoguang wang 2017-09-11 02:06:04 UTC
@@ -609,6 +609,7 @@ spawn_session (State        *state,
                                                      "XAUTHORITY",
                                                      "WAYLAND_DISPLAY",
                                                      "WAYLAND_SOCKET",
+                                                     "GNOME_SHELL_SESSION_MODE",
                                                      NULL };

I think just unset environment "GNOME_SHELL_SESSION_MODE" will break greeter and initial-setup, we need to unset "GNOME_SHELL_SESSION_MODE" just when "GNOME_SHELL_SESSION_MODE=classic".
Comment 11 Ray Strode [halfline] 2017-09-11 13:32:50 UTC
should be fine since we only do the unset if getenv() returns NULL.

Note You need to log in before you can comment on or make changes to this bug.