[gnome-panel] menu: use CanSwitch D-Bus property



commit 2425abfc200c353a9b77e66455f58df01cee8852
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Sep 4 19:07:30 2020 +0300

    menu: use CanSwitch D-Bus property
    
    Lightdm has "allow-user-switching" configuration option that
    can be used to disable user switching.

 modules/menu/gp-lock-logout.c                        | 4 ++++
 modules/menu/org.freedesktop.DisplayManager.Seat.xml | 3 +++
 2 files changed, 7 insertions(+)
---
diff --git a/modules/menu/gp-lock-logout.c b/modules/menu/gp-lock-logout.c
index 19be2dc17..edfce1ca2 100644
--- a/modules/menu/gp-lock-logout.c
+++ b/modules/menu/gp-lock-logout.c
@@ -506,6 +506,10 @@ shutdown_activate_cb (GtkWidget    *item,
 static gboolean
 get_can_switch_user (GpLockLogout *lock_logout)
 {
+  if (lock_logout->seat != NULL &&
+      !gp_dm_seat_gen_get_can_switch (lock_logout->seat))
+    return FALSE;
+
   return TRUE;
 }
 
diff --git a/modules/menu/org.freedesktop.DisplayManager.Seat.xml 
b/modules/menu/org.freedesktop.DisplayManager.Seat.xml
index 70ad52b7f..52558294f 100644
--- a/modules/menu/org.freedesktop.DisplayManager.Seat.xml
+++ b/modules/menu/org.freedesktop.DisplayManager.Seat.xml
@@ -6,5 +6,8 @@
     <annotation name="org.gtk.GDBus.C.Name" value="DmSeatGen" />
 
     <method name="SwitchToGreeter" />
+
+    <property name="CanSwitch" type="b" access="read" />
+
   </interface>
 </node>


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