[KDE Plasma5] Don't start on session resume and auto start at same time #3273

Open
soee opened this Issue May 23, 2015 · 19 comments

Comments

Projects
None yet

soee commented May 23, 2015

Few months ago first versions of Plasma 5 has been released and used by various Linux distributions (i'm using it on Kubuntu 15.04). After switch from KDE4 where Owncloud client worked fine, now with Plasma 5, settings window is always loaded maximized when starting system. This isn't serious bug but should be fixed somehow.

OS: Kubuntu 15.04
DE: Plasma 5.3.0
QT: 5.4.1
Client varsion: 1.8.1

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/17007542-kde-plasma5-don-t-start-on-session-resume-and-auto-start-at-same-time?utm_campaign=plugin&utm_content=tracker%2F216457&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F216457&utm_medium=issues&utm_source=github).

This also happened with Plasma 4 on Kubuntu 14.10. It is annoying having to close it every boot up.

@guruz guruz added the bug label Jun 12, 2015

@guruz guruz changed the title from Client settings window is loaded maximized when booting system (Linux + Plasma 5) to [KDE Plasma5] Client settings window is loaded maximized when booting system Jun 12, 2015

@guruz guruz added this to the 2.0 - Multi-account milestone Jun 12, 2015

@MTRichards MTRichards added the sev4-low label Jun 19, 2015

@dragotin dragotin modified the milestones: next-bugfix-release, 2.0 - Multi-account Jul 16, 2015

@dragotin dragotin modified the milestones: 2.0.1-next, next-bugfix-release Jul 29, 2015

Contributor

guruz commented Aug 31, 2015

Can it actually be that two instances of oC are started?
The first one launches fine into the background (with tray icon).
The second one notices that one is already launched and tells the first one via IPC to show its settings icon

FYI @ogoffart @dragotin

owncloud

BINGO! @guruz you nailed the issue right on the head. I disabled the startup script in System Settings & no more popup. OwnCloud Client is starting up silent once again. Thanks!

Contributor

guruz commented Aug 31, 2015

Great :-) I keep this open in case we have a good idea to automatically avoid this on startup.

I think @ogoffart mentioned something about checking Qt's isSessionRestored()

@guruz guruz removed this from the 2.0.1-next milestone Aug 31, 2015

@guruz guruz changed the title from [KDE Plasma5] Client settings window is loaded maximized when booting system to [KDE Plasma5] Don't start on session resume and auto start at same time Aug 31, 2015

@guruz guruz added this to the 2.2-next milestone Sep 8, 2015

I’d like to help in debugging this issue as I am experiencing it myself on one of my machines (owncloud 2.0.1, Kubuntu 15.04, Plasma 5.3.2). KDE is configured to “Start with an empty session”, owncloud is configured to “Launch on System Startup” and visible in the “Autostart” section of my system settings. Despite that, I can see owncloud’s configuration window after every login to KDE.

@guruz @nixternal If I uncheck ownCloud autostart script from System Setting then it doesn't autostart at all on my system. If I leave it checked which starts ownCloud but starts it unminimized.

Yeah, it worked for a few days then started acting weird again. I shut off remember session & it was still doing it. With remember session set & removing it from startup seemed to give me the best results as it wouldn't pop up as much when starting the system.

One of the users on the mailing list mentioned adding a sleep timer of 5 second could help. There was at least once it didn't work. It does seem to work most of the time.

@guruz guruz assigned guruz and unassigned ogoffart Sep 28, 2015

@guruz guruz added the ReadyToTest label Sep 28, 2015

@guruz guruz modified the milestones: 2.0.2-current, 2.2-next Sep 28, 2015

Member

rperezb commented Oct 1, 2015

@cruessler it'd be great if you may check whether the issue is fixed for you, thx

soee commented Oct 1, 2015

@guruz this link is broken. Can you provide working one ?

Contributor

danimo commented Oct 1, 2015

@soee The link was wrong (nighly -> nightly). Fixed. Please try again.

I just installed revision 6b1bfb4 (built today) and restarted my machine several times. I did not change anything besides that. Unfortunately, the issue persists. Is there any log output I could provide?

@Dianafg76 Dianafg76 removed the ReadyToTest label Oct 7, 2015

Owner

dragotin commented Oct 13, 2015

I checked code a bit. According to
http://code.woboq.org/qt5/qtbase/src/gui/kernel/qguiapplication.cpp.html#1289
the isSessionRestored() decides by the argv of the application if it was started from session. It checks for a argument -session. In my KDE4 based environment, the client is started on session start, but without the -session argument.

@cruessler can you check if the application that is started by your session management has an argument --session <something> or not?

ogoffart added a commit that referenced this issue Oct 15, 2015

Don't show the settings if another instance is started less than 10 s…
…ecs after the apps.

Issue #3273

isSessionRestored was not set correctlty so ignore it
Owner

dragotin commented Oct 15, 2015

With @ogoffart s fix above, this should be solved.

I just upgraded to the latest nightly (c3cf6ae, built October 30) and can still see the settings window after login. owncloud seems to be started without parameters.

~ $ ps aux | grep owncloud
christo+  1700  4.8  0.7 831024 59392 ?        Sl   11:18   0:00 /usr/bin/owncloud

Replacing /usr/bin/owncloud by a script that logs each invocation to a file, reveals that on my machine owncloud is only called once at session start (by kdeinit5).

@guruz guruz assigned ogoffart and unassigned guruz Nov 2, 2015

Contributor

ogoffart commented Nov 4, 2015

@cruessler could you also log a timestamp and see what's the time between the two invkation. We have a 10 seconds timer.

I searched the codebase and I think I found the code that triggered the settings dialog in my case. It is

auto desktopSession = qgetenv("XDG_CURRENT_DESKTOP").toLower();
:

auto desktopSession = qgetenv("XDG_CURRENT_DESKTOP").toLower();
[several lines omitted]
if (!QSystemTrayIcon::isSystemTrayAvailable() && desktopSession != "ubuntu") {
  app.showSettingsDialog();
}

On my machine, $XDG_CURRENT_DESKTOP is KDE by default. Replacing /usr/bin/owncloud by the following shell script made the settings dialog not appear after login.

#!/bin/sh

export XDG_CURRENT_DESKTOP=ubuntu; /usr/bin/owncloud.orig

QSystemTrayIcon::isSystemTrayAvailable() seems to incorrectly return false in the version of Qt I’m using (5.3). On a second machine that is already at Qt 5.4, the issue is not present.

@dragotin dragotin modified the milestones: 2.1-current, 2.0.2 Nov 11, 2015

@Dianafg76 Dianafg76 removed the ReadyToTest label Nov 13, 2015

@guruz guruz modified the milestones: 2.1.1-nextpatch, 2.1-current Nov 18, 2015

@ogoffart ogoffart closed this Dec 21, 2015

@guruz guruz reopened this Dec 21, 2015

@guruz guruz removed this from the 2.1.1-nextpatch milestone Dec 21, 2015

@guruz guruz removed bug sev4-low labels Dec 21, 2015

@ogoffart ogoffart removed their assignment Dec 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment