[Xfce4-commits] <xfwm4:libxfce4ui> Fix Session-Management stuff a bit. (needs debugging, but it seems to work with libxfce4ui now)

Stephan Arts noreply at xfce.org
Sun Jan 10 10:24:52 CET 2010


Updating branch refs/heads/libxfce4ui
         to c1a867e65bf68dda3be3d48edcb63d4305192f7e (commit)
       from 91d5ddea2a9b21282b12dc7e9625a0bde110fca7 (commit)

commit c1a867e65bf68dda3be3d48edcb63d4305192f7e
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Jan 10 10:16:26 2010 +0100

    Fix Session-Management stuff a bit. (needs debugging, but it seems to work with libxfce4ui now)

 configure.ac.in |    2 +-
 src/Makefile.am |    4 ++--
 src/display.h   |    2 +-
 src/events.c    |    5 +++--
 src/icons.c     |    3 +--
 src/main.c      |    1 -
 src/session.c   |   24 ++++++++++++++----------
 7 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index f458afc..047037f 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -72,7 +72,7 @@ AC_CHECK_LIB([Xext], [XShapeCombineShape],
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [gtk_minimum_version])
 XDT_CHECK_PACKAGE([GLADE], [libglade-2.0], [2.0.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [xfce_minimum_version])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], libxfce4ui-1, [libxfce4ui_minimum_version])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], libxfce4ui-1, [libxfce4ui_minimum_version])
 XDT_CHECK_PACKAGE([LIBXFCE4KBD_PRIVATE], libxfce4kbd-private-2, [libxfce4kbd_private_minimum_version])
 XDT_CHECK_PACKAGE([LIBXFCONF], libxfconf-0, [xfconf_minimum_version])
 XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-1.0], [wnck_minimum_version])
diff --git a/src/Makefile.am b/src/Makefile.am
index e34d6f9..d64e50c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,7 +85,7 @@ xfwm4_CFLAGS =								\
 	$(LIBX11_CFLAGS)						\
 	$(LIBXFCONF_CFLAGS)						\
 	$(LIBXFCE4UTIL_CFLAGS)						\
-	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE4UI_CFLAGS)						\
 	$(LIBXFCE4KBD_PRIVATE_CFLAGS)					\
 	$(RENDER_CFLAGS)						\
 	$(LIBSTARTUP_NOTIFICATION_CFLAGS)				\
@@ -102,7 +102,7 @@ xfwm4_LDADD =								\
 	$(LIBX11_LDFLAGS)						\
 	$(LIBXFCONF_LIBS)						\
 	$(LIBXFCE4UTIL_LIBS)						\
-	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4UI_LIBS)						\
 	$(LIBXFCE4KBD_PRIVATE_LIBS)					\
 	$(LIBSTARTUP_NOTIFICATION_LIBS)					\
 	$(RENDER_LIBS)							\
diff --git a/src/display.h b/src/display.h
index e3e6178..f305274 100644
--- a/src/display.h
+++ b/src/display.h
@@ -290,7 +290,7 @@ struct _DisplayInfo
     GdkDisplay *gdisplay;
     Display *dpy;
 
-    SessionClient *session;
+    XfceSMClient *session;
     gboolean quit;
     gboolean reload;
 
diff --git a/src/events.c b/src/events.c
index 0c452a1..898b39e 100644
--- a/src/events.c
+++ b/src/events.c
@@ -41,6 +41,7 @@
 #include <X11/extensions/Xrandr.h>
 #endif
 #include <libxfce4util/libxfce4util.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "misc.h"
 #include "workspaces.h"
@@ -418,7 +419,7 @@ handleKeyPress (DisplayInfo *display_info, XKeyEvent * ev)
                 status = EVENT_FILTER_REMOVE;
                 if (display_info->session)
                 {
-                    logout_session (display_info->session);
+                    xfce_sm_client_request_shutdown(display_info->session, XFCE_SM_CLIENT_SHUTDOWN_HINT_LOGOUT);
                 }
                 break;
             default:
@@ -2308,7 +2309,7 @@ handleEvent (DisplayInfo *display_info, XEvent * ev)
              * Qutting on purpose, update session manager so
              * it does not restart the program immediately
              */
-            client_session_set_restart_style(display_info->session, SESSION_RESTART_IF_RUNNING);
+            xfce_sm_client_set_restart_style(display_info->session, XFCE_SM_CLIENT_RESTART_NORMAL);
             gtk_main_quit ();
         }
     }
diff --git a/src/icons.c b/src/icons.c
index 766eb5c..3b7fcbf 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -32,7 +32,6 @@
 #include <gdk/gdkx.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
 
 #include "inline-default-icon.h"
 #include "icons.h"
@@ -522,5 +521,5 @@ getAppIcon (DisplayInfo *display_info, Window window, int width, int height)
         }
     }
 
-    return xfce_inline_icon_at_size (default_icon_data, width, height);
+    return NULL; /*xfce_inline_icon_at_size (default_icon_data, width, height);*/
 }
diff --git a/src/main.c b/src/main.c
index fee8357..15f0947 100644
--- a/src/main.c
+++ b/src/main.c
@@ -32,7 +32,6 @@
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>
diff --git a/src/session.c b/src/session.c
index 22a7922..41a2719 100644
--- a/src/session.c
+++ b/src/session.c
@@ -40,7 +40,7 @@
 
 #include <gtk/gtk.h>
 #include <glib.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "display.h"
 #include "screen.h"
@@ -706,7 +706,7 @@ sessionMatchWinToSM (Client * c)
 }
 
 static char *
-sessionBuildFilename(SessionClient *client_session)
+sessionBuildFilename(XfceSMClient *client_session)
 {
     gchar *filename, *path, *file;
     GError *error;
@@ -722,7 +722,7 @@ sessionBuildFilename(SessionClient *client_session)
         return NULL;
     }
 
-    file = g_strdup_printf("xfwm4-%s", client_session->given_client_id);
+    file = g_strdup_printf("xfwm4-%s", xfce_sm_client_get_client_id(client_session));
     filename = g_build_filename (path, file, NULL);
     g_free (file);
     g_free (path);
@@ -733,7 +733,7 @@ sessionBuildFilename(SessionClient *client_session)
 static void
 sessionLoad (DisplayInfo *display_info)
 {
-    SessionClient *session;
+    XfceSMClient *session;
     gchar *filename;
 
     session = display_info->session;
@@ -745,11 +745,12 @@ sessionLoad (DisplayInfo *display_info)
     }
 }
 
+/*
 static void
 sessionSavePhase2 (gpointer data)
 {
     DisplayInfo *display_info;
-    SessionClient *session;
+    XfceSMClient *session;
     gchar *filename;
 
     display_info = (DisplayInfo *) data;
@@ -768,24 +769,27 @@ sessionDie (gpointer data)
     DisplayInfo *display_info;
 
     display_info = (DisplayInfo *) data;
-    client_session_set_restart_style(display_info->session, SESSION_RESTART_IF_RUNNING);
+    xfce_sm_client_set_restart_style(display_info->session, XFCE_SM_CLIENT_RESTART_NORMAL);
     display_info->quit = TRUE;
     gtk_main_quit ();
 }
+*/
 
 int
 sessionStart (int argc, char **argv, DisplayInfo *display_info)
 {
-    SessionClient *session;
+    XfceSMClient *session;
 
-    display_info->session = client_session_new (argc, argv, (gpointer) display_info,
-                                                SESSION_RESTART_IMMEDIATELY, 20);
+    display_info->session = xfce_sm_client_get_with_argv (argc, argv,
+                                                XFCE_SM_CLIENT_RESTART_IMMEDIATELY, 20);
     session = display_info->session;
+    /*
     session->data = (gpointer) display_info;
     session->save_phase_2 = sessionSavePhase2;
     session->die = sessionDie;
+    */
 
-    if (session_init (session))
+    if (xfce_sm_client_connect(session, NULL))
     {
         sessionLoad (display_info);
         return 1;



More information about the Xfce4-commits mailing list