[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-xfce-devel] Bug#643292: Bug#643292: Bug#643292: lightdm: empty shutdown menu

On Thu, 29 Sep 2011 16:39:28 +0200, Yves-Alexis Perez <corsac at debian.org> wrote:
> On jeu., 2011-09-29 at 18:19 +0400, Dmitry Kurochkin wrote:
> > I did not try the qt greeter.  And I do not see the issue anymore,
> > apparently because I installed more packages on the system.  I can try
> > reproducing it in a VM but it seems that "looking at source code" method
> > should be more straightforward, especially if you know it.
> Not really, it's just wild guess.
> > 
> > I agree that it looks like a permission issue of some sort. 
> Again, just wild guess.
> >  But I did
> > not see any related warnings or errors in lightdm log.  If lightdm just
> > executes shutdown command directly, I would expect to see the menu items
> > but get permission error when I try to run it.  Since there is no items
> > in the menu, that means lightdm does some check like "am I allowed to
> > shutdown?" or receives a list of shutdown commands from an external
> > service.
> No idea.
> > 
> > I think it is fine for lightdm to not allow shutdown.  But it should not
> > display the shutdown menu icon if it is empty.  Besides a notice in the
> > log may be useful.  And the Debian package should recommend/suggest
> > appropriate package to get the shutdown functionality.
> > 
> > My primary suspects for required Debian package(s) is something related
> > to PolicyKit or ConsoleKit. 
> Please investigate, I didn't see any related issue here, so it looks
> like something on your part. So if you manage to reproduce, feel free to
> add more info, but for now there's not much we can do.

Not sure what you mean by "there's not much we can do".

I confirm that the power menu is empty if there is no PolicyKit
installed (policykit-1 package).  Moreover, it is empty in both GTK and
QT greeter which is no surprise since they use the same dbus calls to
determine which power functions are available.  I think policykit-1
should be added to Recommends for lightdm-gtk-greeter and
lightdm-qt-greeter (but not to lightdm package itself).

Looking at the source code, GTK greeter disables menu items in main()
from greeters/gtk/lightdm-gtk-greeter.c:

    if (!lightdm_get_can_suspend ())
        gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, "suspend_menuitem")));
    if (!lightdm_get_can_hibernate ())
        gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, "hibernate_menuitem")));
    if (!lightdm_get_can_restart ())
        gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, "restart_menuitem")));
    if (!lightdm_get_can_shutdown ())
        gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, "shutdown_menuitem")));

As for the QT greeter, the checks are done in Panel constructor from

    QAction *shutDownAction = new QAction(QIcon::fromTheme("system-shutdown"), "Shutdown", this);
    connect(shutDownAction, SIGNAL(triggered()), this, SLOT(shutdown()));
    ... and so on ...

This should be the right places to hide the shutdown menu icon for GTK
and QT greeter if no actions are available.

Could you please forward this info upstream?

BTW another question is why I do not have suspend and hibernate options
in the menu on a laptop.


> Regards,
> -- 
> Yves-Alexis

Reply to: