Please follow the steps below and check the boxes with [x] once you did the step.
Please provide information about your system and the version of Clementine used.
I just click reboot and even with music stopped, if clementine is in the background it prevents me from rebooting. Just annoying
Only happens in KDE5 as far as I know.
1.) Open clementine
2.) Click reboot/logout
3.) The reboot process is stopped with a popup saying clementine is responsible
Hi @Skincanvas , could you test against bleeding edge version on your configuration? Excelent if you could provide some verbose log for this case. If you could test version from qt5 branch it would be awesome.
If you help me it will be much more fast way to resolve this. Appreciate any kind of contribution.
Below notes for my fast lookup.
Probably this (this touches M$ Win but maybe problem only on Qt4...):
You need to reimplement QCoreApplication::winEventFilter in your QCoreApplication / QApplication derived class, and handle the WM_QUERYENDSESSION message there.
I'm not sure whether WM_QUERYENDSESSION will be delivered to your application or whether it's a broadcast system message (and I don't have a Windows machine handy to test.) If you don't seem to receive this message there, you'll need to install an event filter.
In either case, you need to properly respond to WM_QUERYENDSESSION - that's the message you need to handle.
or
Somebody else had the same problem because of reimplementing QMainWindow::CloseEvent. qtcentre.org/threads/9653-closeEvent-preventing-shutdown Maybe that helps you solving that problem.
or
Read aboout QSessionManager and QApplication::commitData - it's more Qt way
ref: https://stackoverflow.com/questions/3565970/qt-application-blocking-system-shutdown
Honestly I don't know much about troubleshooting. kSystemLog gives these specific pulseaudio errors when rebooting fails
https://imgur.com/QiRW45I
If I press reboot again after this rebooting works and these errors are not present. Also I don't know if its relevant, but apparently this is a problem in the program "SeaFile" as well, and I happened to read in the changelog something relating to SeaFile (but when I viewed the package with pacman -Qi I didn't see SeaFile installed as a dependency so figured that wasn't it, might have useful info though)
https://forum.seafile.com/t/plasma-logout-canceled-by-seafile-applet/3283
Qt4: accept close event on main interface (fix #4606)
If the event is ignored, the Qt4-X11 will reject the quit ICCM request.
This annoyingly caused VLC to inhibit logging out.
As for using a test qt5 branch, how would I do this? The only place I can find with code is the github and it appears that I am on the latest version of qt5-base at least, version 5.13.1-2 built 09 Sep 2019 (which is when the last commit was). I notice that clementine had a small update on September 10th but thats for translations apparently
If there is anything else I can offer I would be glad to help
@Skincanvas thanks for your respond. Great that you want to help and offer and actually helping :)
I notice that clementine had a small update on September 10th but thats for translations apparently
Yes, you are right. On master branch (which is main branch of git repositories most often). All repositories could have branches like trees, and I am asking you to check https://github.com/clementine-player/Clementine/tree/qt5 if you could and have some spare time for that. That require compilation on your own (from docker container or simply in your environment)
I haven't tested that branch.
I don't know but maybe in Qt5 it is already solved - that's why I am asking. :)
If you won't or don't have time - it's completely OK :) but there will be some delay for my tests of that.
Cheers and again, thanks for your help. :)
Yes this problem persists with the qt5 branch
@Skincanvas thanks for your support. So I will investigate asap and fix in master. Then later, test in development qt5 branch.
It isn't a problem, thank you
I'm having the exact same problem. Do you need more traces ?
ASAP I said... ? Sorry, but this one 'asap' isn't fastest. Sorry @Skincanvas
@marco44 if have any - post it please. Say something about used version of application and your OS version. If you want to test another issues same way this will be appreciated. Thanks
Clementine is 1.3.1-831-g664c5a31f (arch version).
Qt is 5.13.2.
Plasma is 5.17.2
What kind of trace can I collect ? For now, here's the ksmserver debug output:
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: Shutdown called with confirm 0 type 0 and mode -1
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: saveSession is false
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: Saving legacy session apps
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: Done saving 0 legacy session apps
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: clients should be empty, false
nov. 06 08:29:53 marco kwin_x11[7252]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 16114, resource id: 10485797, major code: 18 (ChangeProperty), minor code: 0
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco systemd[2361]: run-user-976.mount: Succeeded.
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: completeShutdownOrCheckpoint called
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: 3
nov. 06 08:29:53 marco ksmserver[7239]: org.kde.kf5.ksmserver: Client "/usr/bin/clementine" ( 10dc617263000157302538300000072390008 ) canceled shutdown.
nov. 06 08:29:53 marco pulseaudio[7292]: XSMP error: Offending minor opcode = 8 (SaveYourselfDone)
nov. 06 08:29:53 marco pulseaudio[7292]: Offending sequence number = 8
nov. 06 08:29:53 marco pulseaudio[7292]: Error class = BadState
nov. 06 08:29:53 marco pulseaudio[7292]: Severity = CanContinue
@marco44 could you try workaround here https://forum.manjaro.org/t/slow-shutdown-kde-because-of-doublecmd-qt5/49336/38 ? Is it working for you?
It it turn to be some kind the bug like this I just thank you for now and will end up with debugging on my own later.
You mean setting XDG_CURRENT_DESKTOP=PLASMA in the exec command ?
That was 5 minute search about sth similar. If not works just say it.
Mmmm, I took some time trying to reproduce this… It seems it only occurs when my clementine is "autostarted".
If I run clementine from a konsole (with nohup), there is no shutdown problem. With the default XDG_CURRENT_DESKTOP set to KDE. But when clementine has been run from autostart (which I always do), the shutdown problem occurs.
So that could be irrelevant to mentioned error. That leaves us some tips - thank you @marco44 for testing it for me. For now I have nothing else to say. I reproduce and fix I will return to you.
Mmmm, I took some time trying to reproduce this… It seems it only occurs when my clementine is "autostarted".
If I run clementine from a konsole (with nohup), there is no shutdown problem. With the default XDG_CURRENT_DESKTOP set to KDE. But when clementine has been run from autostart (which I always do), the shutdown problem occurs.
It happens when it's started from a .desktop file. I can reproduce it under KDE 5.18.1.
@msdobrescu that is harder than I known. Less time, sorry for no update
Happens with KDE/Plasma 5.18.4.
100% reproducibility. Always on the first Logout/Shutdown/etc. attempt a desktop notification is shown. The second time logout is clicked it takes around 20seconds to logout.
I asked a question about this on the Kubuntu Forums and one of the people over there came up with a work-round; disable the tray icon! I tried it and it works.
Maybe this will help identify the problem in the code.
@TerryJColes could you share the referal?
Thanks for protip but if you could show sources of such infos. Best
Not a problem, although it was just a suggestion by one of the people:
See Reply 7.
I confirm this tweak works for me, thanks @TerryJColes
@asyd you workarouded with tray icon disable or have some src tweak to project to share?
@TerryJColes could you differentiate the .desktop files as msdobrescu mentioned above? See what is your Clementine .desktop file and other apps. Try to figure when it start to work. That would be awesome to see You working on this.
@TerryJColes could you differentiate the .desktop files as msdobrescu mentioned above? See what is your Clementine .desktop file and other apps. Try to figure when it start to work. That would be awesome to see You working on this.
I'm not sure what your question is asking me to do. You simply need to disable the tray icon. Go to Preferences/Behaviour and uncheck the option 'Show Tray Icon'.
Sorry Terry @TerryJColes with this desktop, I confused that thread with sth else I think.
msdobrescu said sth about this desktop file... grr. Never mind
0) Please turn some debug logging,
1) enable tray icon and wait until late shutdown
2) disable tray icon as you done, and done shutdown.
Please see if you could trace differences in system logs, in windows manager you using.
Your help will make me do that. If you cant do it - try 2 times and learn more about KDE plasma. Good dissect of problem will tell me more about yours and probably we will easily spin the change in binary for You to test.
Last question, will you stand compiling clementine on your own or want to give you a binary?
@JulianVolodia I am happy to carry out the actions that you asked. However I don't know how to turn on debugging in this instance. I can compile the source if that's easier (I'm assuming it's make config then make install).
However, I'm going to be pretty busy for a day or two at least and may not have the time for a while.
as we all. Dont blame yourself, we all doing it as hobby.
if You check out docs here, on clementine project, you will see Compiling from source (linux) which I hope tell you everything. If you encounter problems - file an issue about that problems (os, commit abbrev hash and warning/error which blocks you at least), or ask here. Also, you could fork and enable CI service as it will work on your for as it is working now (but, i complicate things which is better only on long terms, dev side etc... sorry).
Using debugging could tell us more, but could behave in other way. But I rather thought about debugging of your KDE Plasma 5 which I am not familiar with yet to know fluent and must set up things but last time I got some raid problems and have limited space, additional backups "ya know what I mean..". ;///
If you will try 1, 2 times and fail - tell me also.
Try to look for some resources of debuging platform as it, or more verbose logging output. Check the persistance of logging on level you set up i.e. error, warning, or even info messages if you are brave and have enought ROM space. Remember to turn it off after reboot because that could log much muuuch more things than you want to have on your disk..
more, that maybe starts new adventure in your life. Best.
Heres a fix for X11 / Wayland.
The closeEvent override is totally redundant when QGuiApplication will already keep the program alive and not destroy the main window if theres a tray icon. As an aside I discovered that Plasma Wayland doesn't actually _show_ the tray icon but it does exist there.
If anyones got OSX / Windows available to test it out on give it a go and let me know if it breaks minimize / maximize / close / logout / resume. I'd guess it probably does if the override was written in the first place? (albeit like 10+ years ago so it might have been fixed upstream) If so I can look into alternatives to fix this.
Edit: I added this patch on Arch's clementine-git package. If it breaks anything I'll probably hear about it.
Edit: Hey already figured out something wrong. Removing close event stops the program from closing without a tray icon. Updated the gist to fix that.
@JulianVolodia:
However, I'm going to be pretty busy for a day or two at least and may not have the time for a while.
Hmmm. My few days of being busy has turned in to several weeks, so I never got round to doing the requested testing. Sorry about that.
I can see the light at the end of the tunnel now, but I see that a fix has been posted. Is my input still useful?
Works here on gentoo with latest git. Thanks!
Most helpful comment
It happens when it's started from a .desktop file. I can reproduce it under KDE 5.18.1.