Subject: bug#68055: closed (Re: [PATCH 0/2] lightdm: Fix empty session list.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 16 Dec 2024 02:38:02 +0000

Your bug report

#73859: lightdm and lightdm-gtk-greeter do not show session menu in guix.

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
73859: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73859
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH 0/2] lightdm: Fix empty session list.
From: Maxim Cournoyer <[email-masked]>
To: Dariqq <[email-masked]>
Cc: [email-masked]
Date: Mon, 16 Dec 2024 11:35:57 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Dariqq,

Dariqq <[email-masked]> writes:

[...]

> Dariqq (2):
>   gnu: lightdm: Use global sysconfdir.
>   gnu: lightdm-service-type: Add lightdm.conf to /etc/lightdm.

Finally pushed to master (see commits b9d7e15f9f and 3a8e19a61d), after
I had some time to properly review and test it.  I've adjusted the
commit messages a bit, and used this Scheme trick to reuse more of the
install phase arguments:

--8<---------------cut here---------------start------------->8---
               ;; matching tests.
-              (unsetenv "LC_ALL"))))))
+              (unsetenv "LC_ALL")))
+          (replace 'install
+            (lambda* (#:key make-flags #:allow-other-keys #:rest args)
+              ;; Override the sysconfdir flag only for the installation phase,
+              ;; as it attempts to write the sample config files to /etc and
+              ;; fail otherwise.
+              (define make-flags*
+                (append make-flags (list (string-append "sysconfdir="
+                                                        #$output "/etc"))))
+              (apply (assoc-ref %standard-phases 'install)
+                     (append args (list #:make-flags make-flags*))))))))
     (inputs
--8<---------------cut here---------------end--------------->8---

Closing.

-- 
Thanks,
Maxim

Subject: lightdm and lightdm-gtk-greeter do not show session menu in guix.
From: Feng Shu <[email-masked]>
To: "guix-bug" <[email-masked]>
Date: Wed, 27 Dec 2023 15:14:15 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

See previous info:   https://issues.guix.gnu.org/57168

> It works fine, but there are a few gotchas:

> 1. The session selection menu doesn't show the items.  I don't know why.
> Perhaps a regresssion with newer GTK+.

I use below code to test:

1. lightdm-gtk-greeter code:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
>     /* Session menu */                                                                                                    >
>     g_debug ("XXXX: Call lightdm_get_sessions functions from main");                                                      >
>     items = lightdm_get_sessions ();                                                                                      >
>     g_debug ("XXXX: Session menuitem create start.");                                                                     >
>     if (gtk_widget_get_visible (session_menuitem))                                                                        >
>     {                                                                                                                     >
>         GSList *sessions = NULL;                                                                                          >
>                                                                                                                           >
>         if (gtk_icon_theme_has_icon (icon_theme, "document-properties-symbolic"))                                         >
>             session_badge = gtk_image_new_from_icon_name ("document-properties-symbolic", GTK_ICON_SIZE_MENU);            >
>         else                                                                                                              >
>             session_badge = gtk_image_new_from_icon_name ("document-properties", GTK_ICON_SIZE_MENU);                     >
>         gtk_widget_show (session_badge);                                                                                  >
>         gtk_container_add (GTK_CONTAINER (session_menuitem), session_badge);                                              >
>                                                                                                                           >
>         items = lightdm_get_sessions ();                                                                                  >
>         for (item = items; item; item = item->next)                                                                       >
>         {                                                                                                                 >
>             LightDMSession *session = item->data;                                                                         >
>             GtkWidget *radiomenuitem;                                                                                     >
>                                                                                                                           >
>             g_debug ("XXXX: Session items: %s", lightdm_session_get_key (session));                                       >
>                                                                                                                           >
>             radiomenuitem = gtk_radio_menu_item_new_with_label (sessions, lightdm_session_get_name (session));            >
>             g_object_set_data (G_OBJECT (radiomenuitem), SESSION_DATA_KEY, (gpointer) lightdm_session_get_key (session)); >
>             sessions = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radiomenuitem));                               >
>             g_signal_connect (G_OBJECT (radiomenuitem), "activate", G_CALLBACK (session_selected_cb), NULL);              >
>             gtk_menu_shell_append (GTK_MENU_SHELL (session_menu), radiomenuitem);                                         >
>             gtk_widget_show (GTK_WIDGET (radiomenuitem));                                                                 >
>         }                                                                                                                 >
>                                                                                                                           >
>         set_session (NULL);                                                                                               >
>     }                                                                                                                     >
>                                                                                                                           >
>     g_debug ("XXXX: Session menuitem create stop.");                                                                      >
>                                                                                                                           >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

2. liblightdm_gobject code:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> /**                                                                                       >
>  * lightdm_get_sessions:                                                                  >
>  *                                                                                        >
>  * Get the available sessions.                                                            >
>  *                                                                                        >
>  * Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession >
>  **/                                                                                      >
> GList *                                                                                   >
> lightdm_get_sessions (void)                                                               >
> {                                                                                         >
>     g_debug ("Run lightdm_get_session function.");    
>     update_sessions ();                                                                   >
>     return local_sessions;                                                                >
> }                                                                                         >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

In my debian machine, it will show the below log, and I find that
lightdm_get_session will be called successfully.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> DEBUG-Message: 10:51:53.859: XXXX: Call lightdm_get_sessions functions from main                                                  >
> DEBUG-Message: 10:51:53.859: Run lightdm_get_session function.                                                                    >
> DEBUG-Message: 10:51:53.859: Sessions_dir /usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions            >
> DEBUG-Message: 10:51:53.859: Run lightdm_session_class_init.                                                                      >
> DEBUG-Message: 10:51:53.859: Run lightdm_session_init.                                                                            >
> DEBUG-Message: 10:51:53.859: Loaded session /usr/share/xsessions/lightdm-xsession.desktop (Default Xsession, )                    >
> DEBUG-Message: 10:51:53.860: Run lightdm_session_init.                                                                            >
> DEBUG-Message: 10:51:53.860: Loaded session /usr/share/xsessions/xfce.desktop (Xfce 会话, 使用此会话将 Xfce 作为您的桌面环境运行) >
> DEBUG-Message: 10:51:53.860: Run lightdm_session_init.                                                                            >
> DEBUG-Message: 10:51:53.860: Loaded session /usr/share/xsessions/icewm-session.desktop (IceWM Session, 此会话使您登录到 IceWM)    >
> DEBUG-Message: 10:51:53.861: Run lightdm_session_init.                                                                            >
> DEBUG-Message: 10:51:53.861: Loaded session /usr/share/wayland-sessions/weston.desktop (Weston, The reference Wayland server)     >
> DEBUG-Message: 10:51:53.861: XXXX: Session menuitem create start.                                                                 >
> DEBUG-Message: 10:51:53.864: Run lightdm_get_session function.                                                                    >
> DEBUG-Message: 10:51:53.864: XXXX: Session items: lightdm-xsession                                                                >
> DEBUG-Message: 10:51:53.864: XXXX: Session items: icewm-session                                                                   >
> DEBUG-Message: 10:51:53.864: XXXX: Session items: weston                                                                          >
> DEBUG-Message: 10:51:53.864: XXXX: Session items: xfce                                                                            >
> DEBUG-Message: 10:51:53.864: XXXX: Call lightdm_get_sessions functions from set_session, argument: (null)                         >
> DEBUG-Message: 10:51:53.864: Run lightdm_get_session function.                                                                    >
> DEBUG-Message: 10:51:53.864: XXXX: Call lightdm_get_sessions functions from set_session, argument: xfce                           >
> DEBUG-Message: 10:51:53.864: Run lightdm_get_session function.                                                                    >
> DEBUG-Message: 10:51:53.864: XXXX: Session menuitem create stop.                                                                  >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

But in guix, lightdm_get_sessions seem to not be called, for I can not
find string "Run lightdm_get_session function. " in log file, just like
the below:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> DEBUG-Message: 10:51:53.859: XXXX: Call lightdm_get_sessions functions from main                                                  >
> DEBUG-Message: 10:51:53.861: XXXX: Session menuitem create start.                                                                 >
> DEBUG-Message: 10:51:53.864: XXXX: Session menuitem create stop.                                                                  >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

liblightdm-gobject shared library seem to be loaded, for when I remove this lib,
gtk-greeter will not show. 

but why lightdm_get_sessions function do not be called while
liblightdm-gobject is loaded? 

--