No power options in GTK/Qt greeters if PolicyKit not installed

Bug #862826 reported by Yves-Alexis Perez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LightDM GTK Greeter
New
Unknown
LightDM Qt Greeter
Triaged
Low
Unassigned

Bug Description

 affects lightdm
 done

On ven., 2011-09-30 at 00:45 +0400, Dmitry Kurochkin wrote:
> > 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".

You're the one reporting the bug, we never experienced it, so we can
speculate but in the end it helps if you're able to tell us the exact
situation.
>
> I confirm that the power menu is empty if there is no PolicyKit
> installed (policykit-1 package).

Ok, good to know.

> 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).

Yeah, I guess so.
>
> 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
> greeters/qt/panel.cpp:
>
> QAction *shutDownAction = new
> QAction(QIcon::fromTheme("system-shutdown"), "Shutdown", this);
> connect(shutDownAction, SIGNAL(triggered()), this,
> SLOT(shutdown()));
> shutDownAction->setEnabled(QLightDM::canShutdown());
> powerMenu->addAction(shutDownAction);
> ... 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.

Yup, fair enough.
>
> Could you please forward this info upstream?

I'll try another attempt to use the launchpad mail interface :)

Regards,
--
Yves-Alexis

summary: - Re: [Pkg-xfce-devel] Bug#643292: Bug#643292: lightdm: empty shutdown
- menu
+ No power options in GTK/Qt greeters if PolicyKit not installed
Changed in lightdm:
status: New → Triaged
importance: Undecided → Low
affects: lightdm → lightdm-gtk-greeter
Changed in lightdm-qt-greeter:
status: New → Triaged
importance: Undecided → Low
Sean Davis (bluesabre)
Changed in lightdm-gtk-greeter:
importance: Low → Unknown
status: Triaged → Unknown
Changed in lightdm-gtk-greeter:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.