By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 1931

Summary: [Regression] Shutdown icon is not in the KickOff menu anymore
Product: TDE Reporter: Alex Couture <ac586133>
Component: tdebaseAssignee: Slávek Banko <slavek.banko>
Status: RESOLVED FIXED    
Severity: major CC: ac586133, albator78, bugwatch, darrella, michele.calgaro, slavek.banko
Priority: P5    
Version: R14.0.0 [Trinity]   
Hardware: Other   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on: 1941    
Bug Blocks: 2014    
Attachments: kickoff menu
Fix missing shutdown and restart icons in KickOff menu
Fix use offerShutdown in tdehw-lib

Description Alex Couture 2014-02-13 10:29:27 CST
Hi!

On Ubuntu 13.10 with TDE R14 nightly build of Feb 12, 2014, the Shutdown and the Reboot buttons are not there anymore in the KickOff menu. There is only the Logout and the Lock buttons. I use lightdm instead of TDM. It worked well on the nightly builds of a few weeks ago.

Thank you!
-Alexandre
Comment 1 Darrell 2014-02-13 13:37:32 CST
Confirmed on Slackware 14.0 with git package set of Feb. 13.
Comment 2 Darrell 2014-02-14 02:10:45 CST
Using my latest package set from Feb. 13, I traced this to KControl->TDE Components->Session Manager->Offer shutdown options. That check box must be enabled.

As I am not a kickoff or graphical login user, someone else will have to say whether this is a bug.

Did you happen to change this option recently?
Comment 3 Alex Couture 2014-02-14 09:00:52 CST
Hi!

I was not aware that this option existed :)
It is activated. I did cycle the option on and off and back at on, and the shutdown buttons are still not there. I wonder if these ticks only concerns the classic menu.

Thank you!
-Alexandre
Comment 4 Darrell 2014-02-14 18:24:40 CST
The options do not appear in the kickoff menu when X is started from the command line. The options appear only when using a graphical login and a login manager.

When I tested after starting X from the command line, then nothing will expose those options in the kickoff menu, just like Switch User does not appear in the classic menu when starting X from the command line.

That said, when I tested from TDM, toggling the "Offer shutdown" option (and pressing the Apply button), the changes were immediate.

I tested with KDM and everything worked as just described.

Would please test while temporarily using TDM?
Comment 5 Alex Couture 2014-02-14 19:56:44 CST
Hi!

Yes, I understand that if TDE is started from the shell by typing ''startx'', the poweroff option is not available, since the login has been made from the shell.

With TDM, the poweroff and reboot buttons are there as they should.
With lightdm, the link between TDE and lightdm is probably broken, because it worked a few weeks ago.

On my PCLinuxOS remaster, I use GDM from GNOME 2 (yes, parts of PCLinuxOS are outdated: GNOME 3 has not arrived yet). I used it because of a problem with the way the remastered CD booted when TDM was used. So, I worry about if it will work with GDM. I have no way yet to test it yet, until somebody will be nice enough to build TDE R14 PCLinuxOS package set. For François Andriot, it seems to be very easy to build TDE packages for PCLinuxOS, without tons of troubles like some people have with other distros.

Do you know if the release candidate package sets will be build for each distros, as the normal package set, or if they will be built only for the same distro list as the nightly builds?

-Alexandre
Comment 6 Darrell 2014-02-14 20:28:31 CST
>Do you know if the release candidate package sets will be build for each
>distros, as the normal package set, or if they will be built only for the same
>distro list as the nightly builds?
I don't know. You would have to talk to the individual packagers about their plans.

Do LightDM and GDM use session files like Trinity and KDE? The files would be stored in a directory such as /opt/trinity/share/apps/TDM/sessions or /usr/share/apps/TDM/sessions. The tde.desktop session file needs to be found by other login managers to source all environment variables correctly because the tde.desktop file has the full file path to starttde.
Comment 7 Francois Andriot 2014-02-24 12:54:43 CST
I do not have this problem here (Mageia 4, openSUSE 13.1).
Do yo


From what I see in the code, the shutdown menu item in kickoff is set in:
 tdebase/kicker/kicker/ui/k_new_mnu.cpp : 1362

1361    bool maysd = false;
1362    if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown())
1363        maysd = true;

Then the "DM().canShutDown()" is set in :
 tdebase/tdmlib/dmctl.cpp : 173

From what i see there, only TDM and old GDM (GDM for Gnome2 I suppose) are usable to shutdown/reboot computer.

I think this bug is duplicate of bug #1400
http://bugs.trinitydesktop.org/show_bug.cgi?id=1400

I don't understand how it could ever work with LightDM ... even R14 lacks support for LightDM .
Comment 8 Darrell 2014-02-24 14:05:41 CST
I do not have access to other login managers. The only login managers I have access are TDM and KDM.

When the shutdown options are not available in LightDM then bug 1400 probably is the correct place to resolve that.

I tested again with TDM and a new profile. When I enable 'Offer shutdown options' in kcontrol, then I see the options in the kickoff menu. When I disable the kcontrol option then I do not see the shutdwon options in kickoff. This occurs in real time --- I do not have to restart Trinity.

with respect to TDM, this does not seem like a bug to me. The classic menu responds the same way. When I enable the kcontrol option then the Logout dialog shows the shutdown options. When I disable the kcontrol option, the Logout dialog only shows the End Current Session option.

One grudge I have against kickoff is unlike the classic menu, kickoff invokes a 30 second timer, even when 'Confirm logout' is disabled. I don't see an obvious GUI way to disable the 30 second timer. To me, disabling 'Confirm logout' means I want no delays yet kickoff still invokes a 30 second countdown.
Comment 9 Slávek Banko 2014-02-24 20:46:13 CST
It seems that I found the cause.

For restart and shutdown are currently two options: 
1) the use of TDM 
2) the use ConsoleKit 

However, Ubuntu 13.10 (Saucy) allows to use only SsystemD => ConsoleKit may not be present. This means that we have next place where we need to add SystemD support.
Comment 10 Darrell 2014-02-24 20:52:37 CST
My system has consolekit. Toggling the kcontrol 'Show shutdown options' directly affects whether I see shutdown options in kickoff. What is the expected behavior in kickoff?
Comment 11 Slávek Banko 2014-02-24 21:01:23 CST
(Odpověď na komentář #10)
> My system has consolekit. Toggling the kcontrol 'Show shutdown options'
> directly affects whether I see shutdown options in kickoff. What is the
> expected behavior in kickoff?

If there is no ConsoleKit or TDM, then 'Show shutdown options' is without effect. Items are not displayed.
Comment 12 Slávek Banko 2014-02-24 21:08:57 CST
Note: Due to the fact that in the last time I'm close to SystemD and also tdehwlib, I take the task to add SystemD support for shutdown and reboot.
Comment 13 Darrell 2014-02-24 21:51:50 CST
>If there is no ConsoleKit or TDM, then 'Show shutdown options' is without
>effect. Items are not displayed.
Okay, but I do have consolekit installed. The console-kit-daemon is in my process list. Why do I not see the additional options in kickoff?
Comment 14 Francois Andriot 2014-02-24 23:41:58 CST
(En réponse au commentaire 12)
> Note: Due to the fact that in the last time I'm close to SystemD and also
> tdehwlib, I take the task to add SystemD support for shutdown and reboot.

J've already done that here:
http://bugs.trinitydesktop.org/show_bug.cgi?id=1941
Comment 15 Michele Calgaro 2014-03-07 02:47:15 CST
Is this bug still valid with the latest sources?
Comment 16 Alex Couture 2014-03-07 14:36:04 CST
I have not updated my Ubuntu R14 nightly build lappy in the last few day. I'll try to update it soon. Then, I will be able to confirm if it is okay.

Thank you!
-Alexandre
Comment 17 Michele Calgaro 2014-03-08 00:30:14 CST
Thanks Alex, I will wait for your feedback.
This bug is part of the v14.0.0 bug list, so it would be appreciated if you could report about it within a reasonable short time :)
Comment 18 Alex Couture 2014-03-08 11:08:11 CST
I updated my system this morning, and Shutdown/Reboot are present and work when using the classic menu, but they are still not present in the KickOff menu.

Thank you!
-Alexandre
Comment 19 Michele Calgaro 2014-03-08 21:01:49 CST
Created attachment 1997 [details]
kickoff menu

Alex, just to be sure, did you enable the Control Center -> TDE Components -> Session Manager -> Offer shutdown options?
On my system both shutdown and logout are offered.
Comment 20 Alex Couture 2014-03-09 09:22:43 CDT
Hi,

Yes, the option is set as it should. I tried to cycle the option, but the shutdown and reboot are still not there. I use Ubuntu 13.10 with R14 nightly build of March 08, 2014.

-Alexandre
Comment 21 Michele Calgaro 2014-03-09 10:07:24 CDT
Alex, one more question if you don't mind.
Have you tried with a brand new profile or with your existing profile? Eventually could you try a brand new one?
Comment 22 Slávek Banko 2014-03-09 13:13:30 CDT
Created attachment 1998 [details]
Fix missing shutdown and restart icons in KickOff menu

I looked into the code KickOff menu - for shutdown and restart was tested only configuration option and DM. Consolekit and SystemD not.

Please try attached patch.
Comment 23 Alex Couture 2014-03-09 15:33:31 CDT
Hi,

Is there a simple way for me to apply the patch to my system, or does it need compilation?

If compilation is needed, can you apply it to the GIT and when I'll update my system, I'll see if it work.

Thank you!
-Alexandre
Comment 24 Michele Calgaro 2014-03-09 23:04:41 CDT
(In reply to Alex Couture from comment #23)
Alex, the patch requires compiling code.

> Okay, but I do have consolekit installed. The console-kit-daemon is in my
> process list. Why do I not see the additional options in kickoff?
Darrell, if this is still the case in your system, could you try the patch please?
Comment 25 Darrell 2014-03-10 17:59:39 CDT
>Darrell, if this is still the case in your system, could you try the patch
>please?
1) With the patch the extra options now appear regardless of the kcontrol 'Offer shutdown options' setting. This does not seem correct to me. The additional options should abide by the 'Offer shutdown options' setting. The classic menu does abide by the 'Offer shutdown options' setting.

2) Similar to the patch in bug 1291 for logging out, when I select the kickoff Restart or Shutdown and 'Confirm logout' is disabled, I am nonetheless asked to confirm the action and the infamous 30 second timer appears. Seems to me the Shutdown options should abide by the user's 'Confirm logout' setting. Perhaps the appropriate snippets of the patch in bug 1291 should be merged into this bug report patch.

To me the logic should be:

If 'Offer shutdown options' then show shutdown options.
If 'Confirm logout' then show confirmation dialog.

3) With the kickoff menu, both in run level 3 (command line) and run level 4 (TDM), neither the Restart nor Shutdown options do anything on my system. There is nothing in my xsession-error log nor the system logs. I do have the TDM Shutdown options configured. I tested this logged in as root.

This is a kickoff menu bug because the Restart and Shutdown options work correctly with the classic menu, both in run level 3 (command line) and run level 4 (TDM).

4) With the kickoff menu, the Start Operating System option does nothing. I receive the confirmation/30 second dialog. I use GRUB 1. I tested this logged in as root. I selected the Confirm button and also let the 30 second timer time-out. Nothing happens.

With the classic menu, the Start Operating System option does reboot the system but not to the system I selected.

5) With the kickoff and classic menu, Suspend to RAM did work correctly. I do not have my system configured to properly test Suspend to Disk.
Comment 26 Alex Couture 2014-03-10 18:04:38 CDT
(In reply to Michele Calgaro from comment #21)
> Alex, one more question if you don't mind.
> Have you tried with a brand new profile or with your existing profile?
> Eventually could you try a brand new one?

Yes, I tried with a new profile. It does no difference, except that I have a default profile...

-Alexandre
Comment 27 Slávek Banko 2014-03-10 20:30:03 CDT
Created attachment 2005 [details]
Fix use offerShutdown in tdehw-lib

(In reply to Darrell from comment #25)
> >Darrell, if this is still the case in your system, could you try the patch
> >please?
> 1) With the patch the extra options now appear regardless of the kcontrol
> 'Offer shutdown options' setting. This does not seem correct to me. The
> additional options should abide by the 'Offer shutdown options' setting. The
> classic menu does abide by the 'Offer shutdown options' setting.
> 

Good revelations - this is the bug in tdehw-lib.
See this attached patch.
Comment 28 Darrell 2014-03-11 14:50:23 CDT
>See this attached patch.
The Shutdown options now appear only when 'Offer Shutdown options' is enabled.

Restart and Shutdown options now function in the kickoff menu same as classic menu in both run level 3 and 4.

Remaining fixes:

* Same as the classic menu, the kickoff menu should abide by 'Confirm logout' setting.

* Start Operating System option not functioning as expected in either menu.
Comment 29 Slávek Banko 2014-03-14 11:06:24 CDT
Comment on attachment 1998 [details]
Fix missing shutdown and restart icons in KickOff menu

Pushed to GIT in hash 81d9dc49.
Comment 30 Slávek Banko 2014-03-14 11:06:50 CDT
Comment on attachment 2005 [details]
Fix use offerShutdown in tdehw-lib

Pushed to GIT in hash 5960db66.
Comment 31 Slávek Banko 2014-03-14 11:08:43 CDT
Confirm logout will be solved in the context of bug report 1291.