[Xfce4-commits] <xfce4-settings:master> Change the way workspace names are handled.

Nick Schermer noreply at xfce.org
Tue Aug 3 23:34:02 CEST 2010


Updating branch refs/heads/master
         to cfd7e385dbd2746e4e375d71f0888505d37b800c (commit)
       from a1cf1cce0ef931bc6edc3a352b14ce1661782a03 (commit)

commit cfd7e385dbd2746e4e375d71f0888505d37b800c
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Aug 3 23:26:59 2010 +0200

    Change the way workspace names are handled.
    
    Drop the wnck code (+ dep) and instead add some code to
    directly read and monitor the xserver. Wnck had some
    problems with setting the names properly resulting in
    workspaces without good name. Also name changes by other
    appliations were not saved in xfconf.

 configure.ac.in                    |    1 -
 xfce4-settings-helper/Makefile.am  |    5 +-
 xfce4-settings-helper/workspaces.c |  473 +++++++++++++++++++++++++-----------
 xfce4-settings-helper/workspaces.h |    3 +-
 4 files changed, 335 insertions(+), 147 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index a7aa821..87c0d9c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -81,7 +81,6 @@ XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0])
 XDT_CHECK_PACKAGE([LIBXFCE4KBD_PRIVATE], [libxfce4kbd-private-2], [4.7.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
 XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.34])
-XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-1.0], [2.12.0])
 
 XDT_CHECK_PACKAGE([XI], [xi], [1.2.0], [],
 [
diff --git a/xfce4-settings-helper/Makefile.am b/xfce4-settings-helper/Makefile.am
index e4ca94f..3405775 100644
--- a/xfce4-settings-helper/Makefile.am
+++ b/xfce4-settings-helper/Makefile.am
@@ -7,7 +7,6 @@ INCLUDES = \
 	-DSRCDIR=\"$(top_srcdir)\" \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DG_LOG_DOMAIN=\"xfce4-settings-helper\" \
-	-DWNCK_I_KNOW_THIS_IS_UNSTABLE \
 	-DAUTOSTART_FILENAME=\"$(autostart_DATA)\" \
 	$(PLATFORM_CPPFLAGS)
 
@@ -46,7 +45,6 @@ xfce4_settings_helper_CFLAGS = \
 	$(XI_CFLAGS) \
 	$(LIBX11_CFLAGS) \
 	$(LIBNOTIFY_CFLAGS) \
-	$(LIBWNCK_CFLAGS) \
 	$(PLATFORM_CFLAGS)
 
 xfce4_settings_helper_LDFLAGS = \
@@ -65,8 +63,7 @@ xfce4_settings_helper_LDADD = \
 	$(LIBXKLAVIER_LIBS) \
 	$(XI_LIBS) \
 	$(LIBX11_LIBS) \
-	$(LIBNOTIFY_LIBS) \
-	$(LIBWNCK_LIBS)
+	$(LIBNOTIFY_LIBS)
 
 #
 # Optional support for the display settings
diff --git a/xfce4-settings-helper/workspaces.c b/xfce4-settings-helper/workspaces.c
index 1a45cb7..1d2b0dd 100644
--- a/xfce4-settings-helper/workspaces.c
+++ b/xfce4-settings-helper/workspaces.c
@@ -23,10 +23,15 @@
 #include <string.h>
 #endif
 
-#include <dbus/dbus-glib.h>
 #include <xfconf/xfconf.h>
 #include <libxfce4util/libxfce4util.h>
-#include <libwnck/libwnck.h>
+#include <gdk/gdk.h>
+
+#ifdef GDK_WINDOWING_X11
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
+#endif
 
 #include "workspaces.h"
 
@@ -34,214 +39,400 @@
 #define WORKSPACE_NAMES_PROP  "/general/workspace_names"
 #define WORKSPACE_COUNT_PROP  "/general/workspace_count"
 
+
+static void             xfce_workspaces_helper_finalize     (GObject              *object);
+static guint            xfce_workspaces_helper_get_count    (void);
+static GdkFilterReturn  xfce_workspaces_helper_filter_func  (GdkXEvent            *gdkxevent,
+                                                             GdkEvent             *event,
+                                                             gpointer              user_data);
+static GPtrArray       *xfce_workspaces_helper_get_names    (void);
+static void             xfce_workspaces_helper_set_names    (XfceWorkspacesHelper *helper);
+static void             xfce_workspaces_helper_save_names   (XfceWorkspacesHelper *helper);
+static void             xfce_workspaces_helper_prop_changed (XfconfChannel        *channel,
+                                                             const gchar          *property,
+                                                             const GValue         *value,
+                                                             XfceWorkspacesHelper *helper);
+
+
+
 struct _XfceWorkspacesHelper
 {
     GObject parent;
 
-    WnckScreen **screens;
     XfconfChannel *channel;
+
+    GTimeVal       timestamp;
 };
 
-typedef struct _XfceWorkspacesHelperClass
+struct _XfceWorkspacesHelperClass
 {
     GObjectClass parent;
-} XfceWorkspacesHelperClass;
+};
+
 
-static void xfce_workspaces_helper_finalize(GObject *obj);
 
-static void xfce_workspaces_helper_set_names_prop(XfceWorkspacesHelper *helper,
-                                                  GdkScreen *screen,
-                                                  gchar **names);
-static void xfce_workspaces_helper_update_all_names(XfceWorkspacesHelper *helper);
-static void xfce_workspaces_helper_prop_changed(XfconfChannel *channel,
-                                                const gchar *property,
-                                                const GValue *value,
-                                                gpointer user_data);
+#ifdef GDK_WINDOWING_X11
+static Atom atom_net_number_of_desktops = 0;
+static Atom atom_net_desktop_names = 0;
+#endif
+
 
 
 G_DEFINE_TYPE(XfceWorkspacesHelper, xfce_workspaces_helper, G_TYPE_OBJECT)
 
 
+
 static void
 xfce_workspaces_helper_class_init(XfceWorkspacesHelperClass *klass)
 {
-    GObjectClass *gobject_class = (GObjectClass *)klass;
+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
     gobject_class->finalize = xfce_workspaces_helper_finalize;
+
+    atom_net_number_of_desktops = gdk_x11_get_xatom_by_name ("_NET_NUMBER_OF_DESKTOPS");
+    atom_net_desktop_names = gdk_x11_get_xatom_by_name ("_NET_DESKTOP_NAMES");
 }
 
+
 static void
-xfce_workspaces_helper_init(XfceWorkspacesHelper *helper)
+xfce_workspaces_helper_init (XfceWorkspacesHelper *helper)
 {
-    gint w, s, n_screens, n_workspaces;
-    gchar **names;
-    GdkDisplay *display;
-    GdkScreen *screen;
+    GdkWindow    *root_window;
+    GdkEventMask  events;
 
     helper->channel = xfconf_channel_new(WORKSPACES_CHANNEL);
-    names = xfconf_channel_get_string_list(helper->channel,
-                                           WORKSPACE_NAMES_PROP);
-
-    /* FIXME: need to do this for all screens? */
-    display = gdk_display_get_default();
-    n_screens = gdk_display_get_n_screens(display);
-    helper->screens = g_new0(WnckScreen *, n_screens + 1);
-    for(s = 0; s < n_screens; ++s) {
-        helper->screens[s] = wnck_screen_get(s);
-        wnck_screen_force_update(helper->screens[s]);
-
-        if(s == 0) {
-            /* here we assume that all screens will always have the same
-             * number of workspaces, and any changes to this number will
-             * occur at the same time.  this may not be a great assumption,
-             * but it'll do. */
-            g_signal_connect_swapped(G_OBJECT(helper->screens[s]), "workspace-created",
-                                     G_CALLBACK(xfce_workspaces_helper_update_all_names),
-                                     helper);
-            g_signal_connect_swapped(G_OBJECT(helper->screens[s]), "workspace-destroyed",
-                                     G_CALLBACK(xfce_workspaces_helper_update_all_names),
-                                     helper);
-        }
-
-        n_workspaces = wnck_screen_get_workspace_count(helper->screens[s]);
-        if(G_UNLIKELY(!names))
-            names = g_new0(gchar *, n_workspaces + 1);
-        else if(g_strv_length(names) < (guint)n_workspaces)
-            names = g_renew(gchar *, names, n_workspaces + 1);
 
-        for(w = g_strv_length(names); w < n_workspaces; ++w) {
-            /* some of them may not have been set in xfconf */
-            names[w] = g_strdup_printf(_("Workspace %d"), w + 1);
-        }
-        names[w] = NULL;
-
-        screen = gdk_display_get_screen(display, s);
-        xfce_workspaces_helper_set_names_prop(helper, screen, names);
+    /* monitor root window property changes */
+    root_window = gdk_get_default_root_window ();
+    events = gdk_window_get_events (root_window);
+    gdk_window_set_events (root_window, events | GDK_PROPERTY_CHANGE_MASK);
+    gdk_window_add_filter (root_window, xfce_workspaces_helper_filter_func, helper);
 
-    }
+    g_signal_connect (G_OBJECT(helper->channel),
+                      "property-changed::" WORKSPACE_NAMES_PROP,
+                      G_CALLBACK( xfce_workspaces_helper_prop_changed), helper);
+}
 
-    g_strfreev(names);
 
-    g_signal_connect(G_OBJECT(helper->channel),
-                     "property-changed::" WORKSPACE_NAMES_PROP,
-                     G_CALLBACK(xfce_workspaces_helper_prop_changed), helper);
-}
 
 static void
-xfce_workspaces_helper_finalize(GObject *obj)
+xfce_workspaces_helper_finalize (GObject *object)
 {
-    XfceWorkspacesHelper *helper = XFCE_WORKSPACES_HELPER(obj);
+    XfceWorkspacesHelper *helper = XFCE_WORKSPACES_HELPER (object);
 
-    g_signal_handlers_disconnect_by_func(G_OBJECT(helper->channel),
-                                         G_CALLBACK(xfce_workspaces_helper_prop_changed),
+    g_signal_handlers_disconnect_by_func(G_OBJECT (helper->channel),
+                                         G_CALLBACK (xfce_workspaces_helper_prop_changed),
                                          helper);
-    g_object_unref(G_OBJECT(helper->channel));
+    g_object_unref (G_OBJECT (helper->channel));
 
-    g_signal_handlers_disconnect_by_func(G_OBJECT(helper->screens[0]),
-                                         G_CALLBACK(xfce_workspaces_helper_update_all_names),
-                                         helper);
-    g_free(helper->screens);
+    G_OBJECT_CLASS (xfce_workspaces_helper_parent_class)->finalize (object);
+}
+
+
+
+static GdkFilterReturn
+xfce_workspaces_helper_filter_func (GdkXEvent  *gdkxevent,
+                                    GdkEvent   *event,
+                                    gpointer    user_data)
+{
+#ifdef GDK_WINDOWING_X11
+    XfceWorkspacesHelper  *helper = XFCE_WORKSPACES_HELPER (user_data);
+    XEvent                *xevent = gdkxevent;
+    GTimeVal               timestamp;
+
+    if (xevent->type == PropertyNotify)
+    {
+        if (xevent->xproperty.atom == atom_net_number_of_desktops)
+        {
+            /* new workspace was added or removed */
+            xfce_workspaces_helper_set_names (helper);
+        }
+        else if (xevent->xproperty.atom == atom_net_desktop_names)
+        {
+            /* don't respond to our own name changes (1 sec) */
+            g_get_current_time (&timestamp);
+            if (timestamp.tv_sec > helper->timestamp.tv_sec
+                || (timestamp.tv_sec == helper->timestamp.tv_sec
+                    && timestamp.tv_usec > helper->timestamp.tv_usec))
+            {
+                /* someone changed (possibly another application that does
+                 * not update xfconf) the name of a desktop, store the
+                 * new names in xfconf if different*/
+                xfce_workspaces_helper_save_names (helper);
+            }
+        }
+    }
+#endif
 
-    G_OBJECT_CLASS(xfce_workspaces_helper_parent_class)->finalize(obj);
+    return GDK_FILTER_CONTINUE;
 }
 
 
 
-static void
-xfce_workspaces_helper_set_names_prop(XfceWorkspacesHelper *helper,
-                                      GdkScreen *screen,
-                                      gchar **names)
+static GPtrArray *
+xfce_workspaces_helper_get_names (void)
 {
-    GString *names_str;
-    gint i;
+    gboolean     succeed;
+    GdkAtom      utf8_atom, type_returned;
+    gint         i, length, num;
+    GPtrArray   *names = NULL;
+    gchar       *data = NULL;
+    GValue      *val;
+    const gchar *p;
+
+    gdk_error_trap_push ();
+
+    utf8_atom = gdk_atom_intern_static_string ("UTF8_STRING");
+    succeed = gdk_property_get (gdk_get_default_root_window (),
+                                gdk_atom_intern_static_string ("_NET_DESKTOP_NAMES"),
+                                utf8_atom,
+                                0L, G_MAXLONG,
+                                FALSE, &type_returned, NULL, &length,
+                                (guchar **) &data);
+
+    if (gdk_error_trap_pop () == 0
+        && succeed
+        && type_returned == utf8_atom
+        && data != NULL
+        && length > 0)
+    {
+        names = g_ptr_array_new ();
+
+        for (i = 0, num = 0; i < length - 1;)
+        {
+            p = data + i;
 
-    names_str = g_string_new(NULL);
+            if (!g_utf8_validate (p, -1, NULL))
+            {
+                g_warning ("Name of workspace %d is not UTF-8 valid.", num + 1);
+                xfconf_array_free (names);
+                g_free (data);
 
-    for(i = 0; names[i]; ++i)
-        g_string_append_len(names_str, names[i], strlen(names[i]) + 1);
+                return NULL;
+            }
 
-    gdk_error_trap_push();
+            val = g_new0 (GValue, 1);
+            g_value_init (val, G_TYPE_STRING);
+            g_value_set_string (val, p);
+            g_ptr_array_add (names, val);
 
-    gdk_property_change(gdk_screen_get_root_window(screen),
-                        gdk_atom_intern_static_string("_NET_DESKTOP_NAMES"),
-                        gdk_atom_intern_static_string("UTF8_STRING"),
-                        8, GDK_PROP_MODE_REPLACE,
-                        (guchar *)names_str->str, names_str->len + 1);
-    gdk_flush();
+            i += strlen (p) + 1;
+            num++;
+        }
+    }
 
-    gdk_error_trap_pop();
+    g_free (data);
 
-    g_string_free(names_str, TRUE);
+    return names;
 }
 
-static void
-xfce_workspaces_helper_update_all_names(XfceWorkspacesHelper *helper)
-{
-    gint i, n_workspaces = wnck_screen_get_workspace_count(helper->screens[0]);
-    gchar const **names;
 
-    names = g_new0(gchar const *, n_workspaces + 1);
 
-    for(i = 0; i < n_workspaces; ++i) {
-        WnckWorkspace *space = wnck_screen_get_workspace(helper->screens[0], i);
-        names[i] = wnck_workspace_get_name(space);
+static guint
+xfce_workspaces_helper_get_count (void)
+{
+    guint     result = 0;
+    guchar   *data = NULL;
+    gboolean  succeed;
+    GdkAtom   cardinal_atom, type_returned;
+    gint      format_returned;
+
+    gdk_error_trap_push ();
+
+    cardinal_atom = gdk_atom_intern_static_string ("CARDINAL");
+    succeed = gdk_property_get (gdk_get_default_root_window (),
+                                gdk_atom_intern_static_string ("_NET_NUMBER_OF_DESKTOPS"),
+                                cardinal_atom,
+                                0L, 1L,
+                                FALSE, &type_returned, &format_returned, NULL,
+                                &data);
+
+    if (gdk_error_trap_pop () == 0
+        && succeed
+        && data != NULL
+        && type_returned == cardinal_atom
+        && format_returned == 32)
+    {
+        result = (guint) *data;
+    }
+    else
+    {
+        g_warning ("Failed to get the _NET_NUMBER_OF_DESKTOPS property.");
     }
 
-    xfconf_channel_set_string_list(helper->channel, WORKSPACE_NAMES_PROP,
-                                   (const gchar **)names);
-    xfconf_channel_set_int(helper->channel, WORKSPACE_COUNT_PROP, n_workspaces);
+    g_free (data);
 
-    g_free(names);
+    return result;
 }
 
+
+
 static void
-xfce_workspaces_helper_prop_changed(XfconfChannel *channel,
-                                    const gchar *property,
-                                    const GValue *value,
-                                    gpointer user_data)
+xfce_workspaces_helper_set_names (XfceWorkspacesHelper *helper)
 {
-    XfceWorkspacesHelper *helper = user_data;
-    GPtrArray *names_arr;
-    guint s,i, n_workspaces;
-    gchar **names;
-    GdkDisplay *display;
-    GdkScreen *screen;
-
-    if(G_VALUE_TYPE(value) == G_TYPE_INVALID)
+    GString       *names_str;
+    guint          i;
+    guint          n_workspaces;
+    GPtrArray     *names, *existing_names;
+    GValue        *val;
+    gchar         *new_name;
+    const gchar   *name;
+
+    g_return_if_fail (XFCE_IS_WORKSPACES_HELPER (helper));
+
+    n_workspaces = xfce_workspaces_helper_get_count ();
+    if (n_workspaces < 1)
         return;
 
-    if(G_VALUE_TYPE(value) != dbus_g_type_get_collection("GPtrArray",
-                                                         G_TYPE_VALUE))
+    /* check if there are enough names in xfconf, else we save new
+     * names first and set the names the next time property-changed is
+     * triggered on the channel */
+    names = xfconf_channel_get_arrayv (helper->channel, WORKSPACE_NAMES_PROP);
+    if (names != NULL && names->len >= n_workspaces)
     {
-        g_warning("(workspace names) Expected boxed GPtrArray property, got %s",
-                  G_VALUE_TYPE_NAME(value));
-        return;
+        /* store this in xfconf (for no really good reason actually) */
+        xfconf_channel_set_int (helper->channel, WORKSPACE_COUNT_PROP, n_workspaces);
+
+        /* create nul-separated string of names */
+        names_str = g_string_new (NULL);
+
+        for (i = 0; i < names->len && i < n_workspaces; i++)
+        {
+            val = g_ptr_array_index (names, i);
+            name = g_value_get_string (val);
+
+            /* insert the name with nul */
+            g_string_append_len (names_str, name, strlen (name) + 1);
+        }
+
+        /* update stamp so new names is not handled for the next second */
+        g_get_current_time (&helper->timestamp);
+        g_time_val_add (&helper->timestamp, G_USEC_PER_SEC);
+
+        gdk_error_trap_push();
+
+        gdk_property_change (gdk_get_default_root_window (),
+                             gdk_atom_intern_static_string ("_NET_DESKTOP_NAMES"),
+                             gdk_atom_intern_static_string ("UTF8_STRING"),
+                             8, GDK_PROP_MODE_REPLACE,
+                             (guchar *) names_str->str,
+                             names_str->len + 1);
+
+        if (gdk_error_trap_pop () != 0)
+            g_warning ("Failed to change _NET_DESKTOP_NAMES.");
+
+        g_string_free (names_str, TRUE);
+    }
+    else
+    {
+        if (names == NULL)
+            names = g_ptr_array_sized_new (n_workspaces);
+
+        /* get current names set in x */
+        existing_names = xfce_workspaces_helper_get_names ();
+
+        for (i = names->len; i < n_workspaces; i++)
+        {
+            if (existing_names != NULL
+                && existing_names->len > i)
+            {
+                val = g_ptr_array_index (existing_names, i);
+                name = g_value_get_string (val);
+
+                if (name != NULL && *name != '\0')
+                {
+                    /* use the existing name */
+                    g_ptr_array_add (names, val);
+                    continue;
+                }
+            }
+
+            /* no existing name, create a new name */
+            val = g_new0 (GValue, 1);
+            g_value_init (val, G_TYPE_STRING);
+            new_name = g_strdup_printf (_("Workspace %d"), i + 1);
+            g_value_take_string (val, new_name);
+            g_ptr_array_add (names, val);
+        }
+
+        /* store new array in xfconf */
+        if (!xfconf_channel_set_arrayv (helper->channel, WORKSPACE_NAMES_PROP, names))
+             g_critical ("Failed to save xfconf property %s", WORKSPACE_NAMES_PROP);
+
+        xfconf_array_free (existing_names);
     }
 
-    names_arr = g_value_get_boxed(value);
-    if(!names_arr)
+    xfconf_array_free (names);
+}
+
+
+
+static void
+xfce_workspaces_helper_save_names (XfceWorkspacesHelper *helper)
+{
+    GPtrArray   *xfconf_names, *new_names;
+    GValue      *val_b;
+    const gchar *name_a, *name_b;
+    gboolean     save_array = FALSE;
+    guint        i;
+
+    g_return_if_fail (XFCE_IS_WORKSPACES_HELPER (helper));
+
+    new_names = xfce_workspaces_helper_get_names ();
+    if (new_names == NULL)
         return;
 
-    display = gdk_display_get_default();
-    for(s = 0; helper->screens[s]; ++s) {
-        wnck_screen_force_update(helper->screens[s]);
-        n_workspaces = wnck_screen_get_workspace_count(helper->screens[s]);
-        if(n_workspaces > names_arr->len)
-            names = g_new0(gchar *, n_workspaces + 1);
-        else {
-            names = g_new0(gchar *, names_arr->len + 1);
-            n_workspaces = names_arr->len;
-        }
+    xfconf_names = xfconf_channel_get_arrayv (helper->channel, WORKSPACE_NAMES_PROP);
 
-        for(i = 0; i < n_workspaces; ++i) {
-            if(i < names_arr->len && G_VALUE_HOLDS_STRING(g_ptr_array_index(names_arr, i)))
-                names[i] = g_value_dup_string(g_ptr_array_index(names_arr, i));
-            else
-                names[i] = g_strdup_printf(_("Workspace %d"), i + 1);
+    if (xfconf_names == NULL
+       || xfconf_names->len < new_names->len)
+    {
+        /* store the new names in xfconf, should not append often because
+         * we probably saved (and set) a name when the workspace count
+         * was changed */
+        xfconf_channel_set_arrayv (helper->channel, WORKSPACE_NAMES_PROP, new_names);
+    }
+    else if (xfconf_names != NULL
+             && xfconf_names->len >= new_names->len)
+    {
+        /* update the new names in the xfconf array */
+        for (i = 0; i < new_names->len; i++)
+        {
+             name_a = g_value_get_string (g_ptr_array_index (new_names, i));
+
+             val_b = g_ptr_array_index (xfconf_names, i);
+             name_b = g_value_get_string (val_b);
+
+             if (g_strcmp0 (name_a, name_b) != 0)
+             {
+                 /* set the old xfconf name to the new name */
+                 g_value_unset (val_b);
+                 g_value_set_string (val_b, name_a);
+
+                 save_array = TRUE;
+             }
         }
 
-        screen = gdk_display_get_screen(display, s);
-        xfce_workspaces_helper_set_names_prop(helper, screen, names);
-        g_strfreev(names);
+        if (save_array)
+        {
+            xfconf_channel_set_arrayv (helper->channel, WORKSPACE_NAMES_PROP, xfconf_names);
+            g_message ("Saved new workspace names in xfconf.");
+        }
     }
+
+    if (xfconf_names != NULL)
+        xfconf_array_free (xfconf_names);
+    xfconf_array_free (new_names);
+}
+
+
+
+static void
+xfce_workspaces_helper_prop_changed (XfconfChannel        *channel,
+                                     const gchar          *property,
+                                     const GValue         *value,
+                                     XfceWorkspacesHelper *helper)
+{
+    g_return_if_fail (XFCE_IS_WORKSPACES_HELPER (helper));
+    xfce_workspaces_helper_set_names (helper);
 }
diff --git a/xfce4-settings-helper/workspaces.h b/xfce4-settings-helper/workspaces.h
index 3742694..4f8cfc6 100644
--- a/xfce4-settings-helper/workspaces.h
+++ b/xfce4-settings-helper/workspaces.h
@@ -26,7 +26,8 @@ G_BEGIN_DECLS
 #define XFCE_WORKSPACES_HELPER(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), XFCE_TYPE_WORKSPACES_HELPER, XfceWorkspacesHelper))
 #define XFCE_IS_WORKSPACES_HELPER(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), XFCE_TYPE_WORKSPACES_HELPER))
 
-typedef struct _XfceWorkspacesHelper  XfceWorkspacesHelper;
+typedef struct _XfceWorkspacesHelper       XfceWorkspacesHelper;
+typedef struct _XfceWorkspacesHelperClass  XfceWorkspacesHelperClass;
 
 GType xfce_workspaces_helper_get_type(void) G_GNUC_CONST;
 



More information about the Xfce4-commits mailing list