canonical / lightdm

Display Manager
GNU General Public License v3.0
845 stars 139 forks source link

Need help: lightdm and lightdm-gtk-greeter in guix system do not show session menu. #333

Open tumashu opened 11 months ago

tumashu commented 11 months ago

Hello, I have try to fix a issue of lightdm and lightdm-gtk-greeter in guix system, the problem is session menu in lightdm-gtk-greeter is show nothing.

lightdm_get_sessions of lightdm-gtk-greeter seem to return no sessions, for I tested the below code, "XXXX: items3" is not show.

    items = lightdm_get_sessions ();
    g_debug ("XXXX: items1");
    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 ();
        g_debug ("XXXX: items2");
        for (item = items; item; item = item->next)
        {
            LightDMSession *session = item->data;
            GtkWidget *radiomenuitem;

            g_debug ("XXXX: items3");
            g_debug ("XXXX: items3", lightdm_session_get_name (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));
        }

What makes me feel strange is that , ligthdm_get_sessions of lightdm seem to not be called, for I use the below code to test, and /tmp/test0.txt file is not generated.

GList *
lightdm_get_sessions (void)
{
    FILE *fp3 = NULL;
    fp3 = fopen("/tmp/test0.txt", "w+");
    fprintf(fp3, "This is testing for fprintf...\n");
    fputs("xxxxx", fp3);
    fclose(fp3);

    update_sessions ();
    return local_sessions;
}
tumashu commented 11 months ago

It seem that liblightdm-gobject-1.so.0 is loaded, but is lightdm_get_sessions is not called, I do not know why.

https://issues.guix.gnu.org/68055

Ashvith10 commented 2 months ago

@tumashu have you found any solution for this?

tumashu commented 2 months ago

@Ashvith10 no

tumashu commented 2 months ago

can not show wm list, at the moment, we need to special wm manual like below:

(service lightdm-service-type
               (lightdm-configuration
                (seats
                 (list (lightdm-seat-configuration
                        (name "*")
                        (user-session "icewm"))))))