Bug 343875

Summary: Some settings not preserved across sessions
Product: [Unmaintained] ksmserver Reporter: Patrick O'Callaghan <pocallaghan>
Component: generalAssignee: Lubos Lunak <l.lunak>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: bhush94, bluelightning, cenbe, david, Ed.Greshko, gbcox, kevin.kofler, laurent.rineau, leon.maurer, nate, oded, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Patrick O'Callaghan 2015-02-06 21:39:09 UTC
I have "restore manually saved session" as the startup option. On creating several virtual desktops and placing and sizing app windows on them, I save the session. On logging out and in again, a number of these are lost, including:

* All windows for non-KDE apps including Evolution, Chrome and Firefox
* Virtual desktop and window placement for two Dolphin instances (both opened on the 1st desktop instead of the 4th as configured). The size of one of these was preserved, but not for the other.

Some other settings were also lost, including the stacking policy for open apps (I want one panel tab per app, not per window, even when the panel is not full) and the Focus On Mouse window policy was reset to the default.

Reproducible: Always

Steps to Reproduce:
1.Configure manual session preservation
2.Set up desired layout and save.
3.Log out and in again.

Actual Results:  
Settings only partially preserved (see above).

Expected Results:  
Session restored as configured.

Fedora 21, Plasma-5 installed from COPR repo. Possible SELinux violations, including:

Feb 03 13:02:32 Bree python[1504]: SELinux is preventing /usr/libexec/sddm-helper from getattr access on the file /home/poc/.kde/share/apps/kwalle
                                   
                                   *****  Plugin restorecon (99.5 confidence) suggests   ************************
                                   
                                   If you want to fix the label. 
                                   /home/poc/.kde/share/apps/kwallet/kdewallet.salt default label should be config_home_t.
                                   Then you can run restorecon.
                                   Do
                                   # /sbin/restorecon -v /home/poc/.kde/share/apps/kwallet/kdewallet.salt
                                   
                                   *****  Plugin catchall (1.49 confidence) suggests   **************************
                                   
                                   If you believe that sddm-helper should be allowed getattr access on the kdewallet.salt file by default.
                                   Then you should report this as a bug.
                                   You can generate a local policy module to allow this access.
                                   Do
                                   allow this access for now by executing:
                                   # grep sddm-helper /var/log/audit/audit.log | audit2allow -M mypol
                                   # semodule -i mypol.pp
Comment 1 Patrick O'Callaghan 2015-02-07 11:43:43 UTC
On latest reboot, Evolution and Firefox are started correctly. Chrome is not started. All windows open only on the first virtual desktop, with the correct sizes but aligned at the top left corner. Stacking policy on the panel is now correct.

Also (forgot to mention earlier), Bluetooth is off so I have no mouse. I have to use a different mouse to turn it on again, whereupon it works correctly.
Comment 2 Oded Arbel 2015-02-17 19:34:08 UTC
The problem with session restore puts all windows in virtual desktop #1 is also reported as bug #342086
Comment 3 Patrick O'Callaghan 2015-02-20 12:20:59 UTC
I created a test user with minimal configuration: 2 virtual desktops, Konsole on one and Firefox on the other. Same problem, including Bluetooth being off when the session starts.
Comment 4 Patrick O'Callaghan 2015-02-20 12:24:47 UTC
I created a test user with minimal configuration: 2 virtual desktops, Konsole on one and Firefox on the other. Same problem, including Bluetooth being off when the session starts.
Comment 5 Glenn Holmer 2015-03-17 22:04:28 UTC
I tried it with eight desktops (which is what I normally use): a konsole on 1 and Firefox on 8. After logout, both started up, but both on the first desktop and neither in the position I left them in. I ran software updates this morning.
Comment 6 Kevin Kofler 2015-03-19 03:14:59 UTC
Setting to CONFIRMED, 3 reports on the Fedora KDE mailing list ought to be enough!
Comment 7 Patrick O'Callaghan 2015-03-27 12:09:46 UTC
Just updated to plasma 5.2.1 and kf5 5.8.0. The problem persists.
Comment 8 Patrick O'Callaghan 2015-03-31 11:05:34 UTC
Plasma 5.2.2. Still broken.
Comment 9 Patrick O'Callaghan 2015-04-01 11:38:02 UTC
I noticed this in the logs. It may or may not have something to do with the problem:

Mar 29 11:26:06 Bree setroubleshoot[1498]: Plugin Exception restorecon_source
Mar 29 11:26:06 Bree setroubleshoot[1498]: SELinux is preventing /usr/libexec/sddm-helper from open access on the file /home/poc/.Xauthority.
Comment 10 Patrick O'Callaghan 2015-04-21 18:28:59 UTC
(In reply to Patrick O'Callaghan from comment #4)
> I created a test user with minimal configuration: 2 virtual desktops,
> Konsole on one and Firefox on the other. Same problem, including Bluetooth
> being off when the session starts.

The Bluetooth issue is probably unrelated. I worked around it by creating a rc.local file to run "hciconfig hci0 up".
Comment 11 Glenn Holmer 2015-04-28 13:16:04 UTC
Just upgraded to Plasma 5.3 via PPA. Still broken.
Comment 12 David Lang 2015-05-12 20:36:29 UTC
I can also confirm that this still happens with Plasma 5.3 PPA on Kubuntu 15.04

Also, If I start firefox (or chrome) from a terminal, logging in should restore that terminal window, not start firefox outside that window. KDE is looking and seeing that firefox was running at shutdown, but not looking at how it was running (command-line switches for example). since this is related to how things start up in a new session, I think it's relevant to this bug.
Comment 13 Rex Dieter 2015-05-12 21:38:57 UTC
this is possibly a dup of bug #346768 (now fixed, in kxmlgui)
Comment 14 Patrick O'Callaghan 2015-05-12 22:28:38 UTC
I have several Chrome windows, each with several tabs, running on separate desktops. Absolutely nothing is restored, i.e. Chrome simply doesn't start up when I log in. When I run it manually, the windows are restored but all on the same desktop. Each window has the correct tabs except one, which always opens a specific additional tab, even though I close it every time and even if I save the session.
Comment 15 Ed Greshko 2015-05-13 13:09:40 UTC
I have updated to kf5-plasma-5.10.0-2.fc22 and the following scenario still fails....

 I am using "folder view" as my desktop settings and I'm configured to restore from a "saved session".  I do the following....

1.  login
2.  start konsole, place it in the lower right edge of the screen and set it to "all desktops".  4 virtual desktops in use.
3.  start tbird, place in desktop 2 and align it to the left edge of the screen with a width which brings it into contact with the left edge of konsole.
4.  Go to "leave" and click on "Save Session" and the following files get modified...

[egreshko@f22-tc3 ~]$ find . -cmin -1
./.xsession-errors
./.config
./.config/ksmserverrc
./.config/session
./.config/session/kmix_1028c1d320b210000143113812800000013960009_1431501798_448141
./.config/session/konsole_1028c1d320b210000143122570000000015410009_1431501798_463485
./.cache/plasma_theme_polishedStones_v4.11.kcache

5.  Logout/Login
6.  konsole and tbird are started.  But they are both on Desktop 1 and they are out of position.
Comment 16 Patrick O'Callaghan 2015-07-01 10:56:22 UTC
Now on kf5-plasma-5.11.0-1.fc22.x86_64. Still no improvement. This is getting old really quickly.
Comment 17 Patrick O'Callaghan 2015-07-05 17:28:07 UTC
Current status with kf5-plasma-5.11.0-1.fc22.x86_64: KDE apps such as Dolphin and Konsole seem to work, but Firefox starts with the "This is embarassing" pane. Chrome doesn't start at all, and when started manually also needs a button press to restore windows, which do not go to the correct desktops. Granted that these may be bugs in the respective apps, but they weren't present under KDE4. Maybe a problem with the way Plasma shuts down.
Comment 18 Patrick O'Callaghan 2015-07-06 09:49:08 UTC
(In reply to Patrick O'Callaghan from comment #17)
> Current status with kf5-plasma-5.11.0-1.fc22.x86_64: KDE apps such as
> Dolphin and Konsole seem to work, but Firefox starts with the "This is
> embarassing" pane. Chrome doesn't start at all, and when started manually
> also needs a button press to restore windows, which do not go to the correct
> desktops. Granted that these may be bugs in the respective apps, but they
> weren't present under KDE4. Maybe a problem with the way Plasma shuts down.

Correction: I have a Dolphin window of about half the screen width and with a terminal panel. On restarting, the window is full-width and the panel is shrunk to zero size.
Comment 19 Patrick O'Callaghan 2016-03-24 12:27:12 UTC
Just a note to say that this still isn't fixed. The current status:

* kf5-plasma-5.19.0-2.fc23.x86_64
* Firefox starts on the correct desktop but with the "This is embarassing" page. On clicking the button, the extra window starts up correctly, but on the current desktop rather the assigned one.
* Chrome doesn't start at all. When started manually, it fires up all the correct windows and tabs but on the current desktop instead of the assigned ones.

The problem with Dolphin appears to be fixed.

IOW at present my problems are with non-KDE apps. At present I have very low expectation of this ever being fixed.
Comment 20 Patrick O'Callaghan 2016-03-24 12:45:27 UTC
Just a note to say that this still isn't fixed. The current status:

* kf5-plasma-5.19.0-2.fc23.x86_64
* Firefox starts on the correct desktop but with the "This is embarassing" page. On clicking the button, the extra window starts up correctly, but on the current desktop rather the assigned one.
* Chrome doesn't start at all. When started manually, it fires up all the correct windows and tabs but on the current desktop instead of the assigned one.

The problem with Dolphin appears to be fixed.

IOW at present my problems are with non-KDE apps. At present I have very low expectation of this ever being fixed.
Comment 21 Nate Graham 2020-09-29 03:37:40 UTC
Yes I'm afraid it's all up to the 3rd-party apps at this point.