[Xfce4-commits] r19140 - in xfce4-session/trunk: . icons/48x48 xfce4-session

Olivier Fourdan fourdan at xfce.org
Thu Dec 29 13:14:38 CET 2005


Hi Jasper,

That patch breaks the session manager, it now crashes at logout, after 
selecting one of the icons.

For example, select the "Restart" icon, the session returns to gdm 
because the session maanager crashed before initating the restart.

#0  0xb7a5be9e in g_type_check_instance_cast ()
    from /local/lib/libgobject-2.0.so.0
#1  0x080505fd in shutdownDialog ()
#2  0x08055035 in xfsm_manager_save_yourself ()
#3  0x08051162 in sm_save_yourself_request ()
#4  0x432cd043 in _SmsProcessMessage () from /usr/X11R6/lib/libSM.so.6
#5  0x432b5c19 in IceProcessMessages () from /usr/X11R6/lib/libICE.so.6
#6  0x0804ec15 in ice_process_messages ()
#7  0xb79f9809 in g_io_unix_dispatch () from /local/lib/libglib-2.0.so.0
#8  0xb79cc37c in g_main_dispatch () from /local/lib/libglib-2.0.so.0
#9  0xb79cd6d0 in g_main_context_dispatch () from 
/local/lib/libglib-2.0.so.0
#10 0xb79cdbee in g_main_context_iterate () from /local/lib/libglib-2.0.so.0
#11 0xb79ce3a7 in g_main_loop_run () from /local/lib/libglib-2.0.so.0
#12 0xb7d38a9f in gtk_main () from /local/lib/libgtk-x11-2.0.so.0
#13 0x0804f753 in main ()

Cheers,
Olivier.

Jasper Huijsmans wrote:
> Author: jasper
> Date: 2005-12-28 15:24:46 +0000 (Wed, 28 Dec 2005)
> New Revision: 19140
> 
> Added:
>    xfce4-session/trunk/icons/48x48/xfsm-logout.png
>    xfce4-session/trunk/icons/48x48/xfsm-reboot.png
> Modified:
>    xfce4-session/trunk/configure.in.in
>    xfce4-session/trunk/icons/48x48/Makefile.am
>    xfce4-session/trunk/xfce4-session/shutdown.c
> Log:
> Update the look of the shutdown dialog (Bug #1074).
> 
> Modified: xfce4-session/trunk/configure.in.in
> ===================================================================
> --- xfce4-session/trunk/configure.in.in	2005-12-27 17:20:45 UTC (rev 19139)
> +++ xfce4-session/trunk/configure.in.in	2005-12-28 15:24:46 UTC (rev 19140)
> @@ -9,7 +9,7 @@
>  dnl Version information
>  m4_define([xfsm_version_major], [4])
>  m4_define([xfsm_version_minor], [3])
> -m4_define([xfsm_version_micro], [1])
> +m4_define([xfsm_version_micro], [2])
>  m4_define([xfsm_version_build], [@REVISION@])
>  m4_define([xfsm_version_tag], [svn])
>  m4_define([xfsm_version], [xfsm_version_major().xfsm_version_minor().xfsm_version_micro()ifelse(xfsm_version_build(), [], [], [xfsm_version_tag()[-r]xfsm_version_build()])])
> @@ -46,10 +46,10 @@
>  
>  dnl check for standard header files
>  AC_HEADER_STDC
> -AC_CHECK_FUNCS([getaddrinfo gethostbyname gethostname sigaction strdup sync])
>  AC_CHECK_HEADERS([errno.h fcntl.h limits.h netdb.h signal.h stdarg.h \
>    sys/param.h sys/resource.h sys/socket.h sys/time.h sys/wait.h sys/utsname.h \
>    time.h unistd.h])
> +AC_CHECK_FUNCS([getaddrinfo gethostbyname gethostname sigaction strdup sync])
>  
>  dnl Check for X11 installed
>  XDT_CHECK_LIBX11_REQUIRE()
> 
> Modified: xfce4-session/trunk/icons/48x48/Makefile.am
> ===================================================================
> --- xfce4-session/trunk/icons/48x48/Makefile.am	2005-12-27 17:20:45 UTC (rev 19139)
> +++ xfce4-session/trunk/icons/48x48/Makefile.am	2005-12-28 15:24:46 UTC (rev 19140)
> @@ -2,6 +2,8 @@
>  icons_DATA = 								\
>  	xfce4-session.png						\
>  	xfce4-splash.png						\
> +	xfsm-logout.png						\
> +	xfsm-reboot.png						\
>  	xfsm-shutdown.png
>  
>  EXTRA_DIST = $(icons_DATA)
> 
> Added: xfce4-session/trunk/icons/48x48/xfsm-logout.png
> ===================================================================
> (Binary files differ)
> 
> 
> Property changes on: xfce4-session/trunk/icons/48x48/xfsm-logout.png
> ___________________________________________________________________
> Name: svn:mime-type
>    + application/octet-stream
> 
> Added: xfce4-session/trunk/icons/48x48/xfsm-reboot.png
> ===================================================================
> (Binary files differ)
> 
> 
> Property changes on: xfce4-session/trunk/icons/48x48/xfsm-reboot.png
> ___________________________________________________________________
> Name: svn:mime-type
>    + application/octet-stream
> 
> Modified: xfce4-session/trunk/xfce4-session/shutdown.c
> ===================================================================
> --- xfce4-session/trunk/xfce4-session/shutdown.c	2005-12-27 17:20:45 UTC (rev 19139)
> +++ xfce4-session/trunk/xfce4-session/shutdown.c	2005-12-28 15:24:46 UTC (rev 19140)
> @@ -59,6 +59,7 @@
>  
>  static XfsmShutdownHelper *shutdown_helper = NULL;
>  
> +static GtkWidget *shutdown_dialog = NULL;
>  
>  #ifdef SESSION_SCREENSHOTS
>  static void
> @@ -109,7 +110,30 @@
>    gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
>  }
>  
> +static void
> +logout_button_clicked (GtkWidget *b, gint *shutdownType)
> +{
> +    *shutdownType = SHUTDOWN_LOGOUT;
>  
> +    gtk_dialog_response (GTK_DIALOG (shutdown_dialog), GTK_RESPONSE_OK);
> +}
> +
> +static void
> +reboot_button_clicked (GtkWidget *b, gint *shutdownType)
> +{
> +    *shutdownType = SHUTDOWN_REBOOT;
> +
> +    gtk_dialog_response (GTK_DIALOG (shutdown_dialog), GTK_RESPONSE_OK);
> +}
> +
> +static void
> +halt_button_clicked (GtkWidget *b, gint *shutdownType)
> +{
> +    *shutdownType = SHUTDOWN_HALT;
> +
> +    gtk_dialog_response (GTK_DIALOG (shutdown_dialog), GTK_RESPONSE_OK);
> +}
> +
>  /*
>   */
>  gboolean
> @@ -123,17 +147,18 @@
>  	GtkWidget *dbox;
>  	GtkWidget *hbox;
>  	GtkWidget *vbox;
> +	GtkWidget *vbox2;
>  	GtkWidget *image;
> -  GtkWidget *radio_vbox;
> -  GtkWidget *radio_logout;
> -  GtkWidget *radio_reboot;
> -  GtkWidget *radio_halt;
>  	GtkWidget *checkbox;
>    GtkWidget *entry_vbox;
>    GtkWidget *entry;
>  	GtkWidget *hidden;
> +  GtkWidget *logout_button;
> +  GtkWidget *reboot_button;
> +  GtkWidget *halt_button;
> +  GtkWidget *cancel_button;
>    GtkWidget *ok_button;
> -  GtkWidget *cancel_button;
> +  GtkWidget *header;
>    GdkPixbuf *icon;
>    gboolean saveonexit;
>    gboolean autosave;
> @@ -262,11 +287,16 @@
>        gtk_window_set_decorated (GTK_WINDOW (dialog), FALSE);
>      }
>  
> +  shutdown_dialog = dialog;
> +
>    cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL,
>                                           GTK_RESPONSE_CANCEL);
> +
>    ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK,
>                                       GTK_RESPONSE_OK);
>  
> +  gtk_widget_hide (ok_button);
> +
>  	gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
>    gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
>  	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
> @@ -274,44 +304,91 @@
>  
>  	dbox = GTK_DIALOG(dialog)->vbox;
>  
> -	hbox = gtk_hbox_new(FALSE, 0);
> -	gtk_box_pack_start(GTK_BOX(dbox), hbox, TRUE, TRUE, BORDER);
> -	gtk_widget_show(hbox);
> +  header = xfce_create_header (NULL, _("End Session"));
> +  gtk_container_set_border_width (GTK_CONTAINER (GTK_BIN (header)->child), 
> +                                  BORDER+2);
> +  gtk_widget_show (header);
> +  gtk_box_pack_start (GTK_BOX (dbox), header, TRUE, TRUE, 0);
> +  
> + 	vbox = gtk_vbox_new(FALSE, BORDER);
> +	gtk_box_pack_start(GTK_BOX(dbox), vbox, TRUE, TRUE, 0);
> +  gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
> +	gtk_widget_show(vbox);
>  
> -  icon = xfce_themed_icon_load ("xfsm-shutdown", 48);
> -	image = gtk_image_new_from_pixbuf (icon);
> -	gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, TRUE, BORDER);
> -	gtk_widget_show(image);
> +  hbox = gtk_hbox_new (TRUE, BORDER);
> +  gtk_widget_show (hbox);
> +  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
> +  
> +  /* logout */
> +  logout_button = gtk_button_new ();
> +  gtk_widget_show (logout_button);
> +  gtk_box_pack_start (GTK_BOX (hbox), logout_button, TRUE, TRUE, 0);
> +
> +  g_signal_connect (logout_button, "clicked", 
> +                    G_CALLBACK (logout_button_clicked), shutdownType);
> +
> +  vbox2 = gtk_vbox_new (FALSE, BORDER);
> +  gtk_container_set_border_width (GTK_CONTAINER (vbox2), BORDER);
> +  gtk_widget_show (vbox2);
> +  gtk_container_add (GTK_CONTAINER (logout_button), vbox2);
> +
> +  icon = xfce_themed_icon_load ("xfsm-logout", 32);
> +  image = gtk_image_new_from_pixbuf (icon);
> +  gtk_widget_show (image);
> +  gtk_box_pack_start (GTK_BOX (vbox2), image, FALSE, FALSE, 0);
>    g_object_unref (icon);
>  
> -	vbox = gtk_vbox_new(FALSE, 0);
> -	gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, BORDER);
> -	gtk_widget_show(vbox);
> +  label = gtk_label_new (_("Log Out"));
> +  gtk_widget_show (label);
> +  gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
> +  
> +  /* reboot */
> +  reboot_button = gtk_button_new ();
> +  gtk_widget_show (reboot_button);
> +  gtk_box_pack_start (GTK_BOX (hbox), reboot_button, TRUE, TRUE, 0);
>  
> -	label = gtk_label_new(_("What do you want to do next?"));
> -	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, BORDER);
> -	gtk_widget_show(label);
> +  g_signal_connect (reboot_button, "clicked", 
> +                    G_CALLBACK (reboot_button_clicked), shutdownType);
>  
> -  radio_vbox = gtk_vbox_new (FALSE, 0);
> -  gtk_box_pack_start (GTK_BOX (vbox), radio_vbox, TRUE, FALSE, BORDER);
> -  gtk_widget_show (radio_vbox);
> +  vbox2 = gtk_vbox_new (FALSE, BORDER);
> +  gtk_container_set_border_width (GTK_CONTAINER (vbox2), BORDER);
> +  gtk_widget_show (vbox2);
> +  gtk_container_add (GTK_CONTAINER (reboot_button), vbox2);
>  
> -  radio_logout = gtk_radio_button_new_with_label (
> -      NULL, _("Quit current session"));
> -  gtk_box_pack_start (GTK_BOX (radio_vbox), radio_logout, FALSE, FALSE, 0);
> -  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_logout), TRUE);
> -  gtk_widget_show (radio_logout);
> +  icon = xfce_themed_icon_load ("xfsm-reboot", 32);
> +  image = gtk_image_new_from_pixbuf (icon);
> +  gtk_widget_show (image);
> +  gtk_box_pack_start (GTK_BOX (vbox2), image, FALSE, FALSE, 0);
> +  g_object_unref (icon);
>  
> -  radio_reboot = gtk_radio_button_new_with_label_from_widget (
> -      GTK_RADIO_BUTTON (radio_logout), _("Reboot the computer"));
> -  gtk_box_pack_start (GTK_BOX (radio_vbox), radio_reboot, FALSE, FALSE, 0);
> -  gtk_widget_show (radio_reboot);
> +  label = gtk_label_new (_("Restart"));
> +  gtk_widget_show (label);
> +  gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
> +  
> +  /* halt */
> +  halt_button = gtk_button_new ();
> +  gtk_widget_show (halt_button);
> +  gtk_box_pack_start (GTK_BOX (hbox), halt_button, TRUE, TRUE, 0);
>  
> -  radio_halt = gtk_radio_button_new_with_label_from_widget (
> -      GTK_RADIO_BUTTON (radio_logout), _("Turn off the computer"));
> -  gtk_box_pack_start (GTK_BOX (radio_vbox), radio_halt, FALSE, FALSE, 0);
> -  gtk_widget_show (radio_halt);
> +  g_signal_connect (halt_button, "clicked", 
> +                    G_CALLBACK (halt_button_clicked), shutdownType);
>  
> +  vbox2 = gtk_vbox_new (FALSE, BORDER);
> +  gtk_container_set_border_width (GTK_CONTAINER (vbox2), BORDER);
> +  gtk_widget_show (vbox2);
> +  gtk_container_add (GTK_CONTAINER (halt_button), vbox2);
> +
> +  icon = xfce_themed_icon_load ("xfsm-shutdown", 32);
> +  image = gtk_image_new_from_pixbuf (icon);
> +  gtk_widget_show (image);
> +  gtk_box_pack_start (GTK_BOX (vbox2), image, FALSE, FALSE, 0);
> +  g_object_unref (icon);
> +  
> +  label = gtk_label_new (_("Shut Down"));
> +  gtk_widget_show (label);
> +  gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
> +  
> +  /* save session */
>    if (!autosave)
>      {
>        checkbox = gtk_check_button_new_with_mnemonic(
> @@ -333,11 +410,11 @@
>    xfce_gtk_window_center_on_monitor (GTK_WINDOW (dialog), screen, monitor);
>  
>    /* connect to the shutdown helper */
> -  shutdown_helper = xfsm_shutdown_helper_spawn ();
> -  if (shutdown_helper == NULL || !kiosk_can_shutdown)
> +  if (!kiosk_can_shutdown || 
> +      (shutdown_helper = xfsm_shutdown_helper_spawn ()) == NULL)
>      {
> -      gtk_widget_set_sensitive (radio_reboot, FALSE);
> -      gtk_widget_set_sensitive (radio_halt, FALSE);
> +      gtk_widget_set_sensitive (reboot_button, FALSE);
> +      gtk_widget_set_sensitive (halt_button, FALSE);
>      }
>  
>    /* save portion of the root window covered by the dialog */
> @@ -350,7 +427,7 @@
>  
>  	/* need to realize the dialog first! */
>  	gtk_widget_show_now (dialog);
> -  gtk_widget_grab_focus (ok_button);
> +  gtk_widget_grab_focus (logout_button);
>  
>  	/* Grab Keyboard and Mouse pointer */
>    if (!accessibility)
> @@ -362,12 +439,6 @@
>  	if (result == GTK_RESPONSE_OK) {
>  		*saveSession = autosave || gtk_toggle_button_get_active(
>  				GTK_TOGGLE_BUTTON(checkbox));
> -    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_logout)))
> -      *shutdownType = SHUTDOWN_LOGOUT;
> -    else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_reboot)))
> -      *shutdownType = SHUTDOWN_REBOOT;
> -    else
> -      *shutdownType = SHUTDOWN_HALT;
>  	}
>  
>    gtk_widget_hide (dialog);
> @@ -376,12 +447,14 @@
>    if (result == GTK_RESPONSE_OK && *shutdownType != SHUTDOWN_LOGOUT
>        && xfsm_shutdown_helper_need_password (shutdown_helper))
>      {
> +      gtk_widget_show (ok_button);
> +
>        if (checkbox != NULL)
>          gtk_widget_destroy (checkbox);
> -      gtk_widget_destroy (radio_vbox);
> +      gtk_widget_destroy (vbox);
>  
>        entry_vbox = gtk_vbox_new (FALSE, BORDER);
> -      gtk_box_pack_start (GTK_BOX (vbox), entry_vbox, TRUE, TRUE, 0);
> +      gtk_box_pack_start (GTK_BOX (dbox), entry_vbox, TRUE, TRUE, BORDER);
>        gtk_widget_show (entry_vbox);
>  
>  #if GTK_CHECK_VERSION(2,4,0)
> @@ -417,10 +490,6 @@
>  
>            if (!xfsm_shutdown_helper_send_password (shutdown_helper, pw))
>              {
> -              gtk_image_set_from_stock (GTK_IMAGE (image),
> -                                        GTK_STOCK_DIALOG_ERROR,
> -                                        GTK_ICON_SIZE_DIALOG);
> -
>                gtk_label_set_text (GTK_LABEL (label),
>                                    _("<b>An error occured</b>"));
>                gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
> @@ -464,6 +533,8 @@
>  	gtk_widget_destroy(dialog);
>    gtk_widget_destroy(hidden);
>  
> +  shutdown_dialog = NULL;
> +
>  	/* Release Keyboard/Mouse pointer grab */
>    if (!accessibility)
>      {
> 
> _______________________________________________
> Xfce4-commits mailing list
> Xfce4-commits at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-commits
> 
> 





More information about the Xfce4-dev mailing list