--- a/gntwm.c Mon Apr 22 03:20:47 2019 -0400
+++ b/gntwm.c Tue Apr 23 20:44:47 2019 +0000
@@ -1687,16 +1687,8 @@
-free_workspaces(gpointer data, G_GNUC_UNUSED gpointer n)
void gnt_wm_set_workspaces(GntWM *wm, GList *workspaces)
- g_list_foreach(wm->workspaces, free_workspaces, NULL);
wm->workspaces = workspaces;
gnt_wm_switch_workspace(wm, 0);
--- a/gntws.c Mon Apr 22 03:20:47 2019 -0400
+++ b/gntws.c Tue Apr 23 20:44:47 2019 +0000
@@ -29,7 +29,12 @@
-G_DEFINE_TYPE(GntWS, gnt_ws, GNT_TYPE_BINDABLE)
+G_DEFINE_TYPE_WITH_PRIVATE(GntWS, gnt_ws, GNT_TYPE_BINDABLE) /******************************************************************************
@@ -60,16 +65,27 @@
*****************************************************************************/
+gnt_ws_destroy(GObject *obj) + GntWS *ws = GNT_WS(obj); + GntWSPrivate *priv = gnt_ws_get_instance_private(ws);
-gnt_ws_class_init(G_GNUC_UNUSED GntWSClass *klass)
+gnt_ws_class_init(GntWSClass *klass) + GObjectClass *obj_class = G_OBJECT_CLASS(klass); + obj_class->dispose = gnt_ws_destroy; /******************************************************************************
@@ -148,8 +164,13 @@
gnt_ws_set_name(GntWS *ws, const gchar *name)
- ws->name = g_strdup(name);
+ GntWSPrivate *priv = NULL; + g_return_if_fail(GNT_IS_WS(ws)); + priv = gnt_ws_get_instance_private(ws); + priv->name = g_strdup(name); @@ -176,15 +197,25 @@
widget_show(l->data, nodes);
-GntWS *gnt_ws_new(const char *name)
+gnt_ws_new(const gchar *name) GntWS *ws = GNT_WS(g_object_new(GNT_TYPE_WS, NULL));
- ws->name = g_strdup(name ? name : "(noname)");
+ GntWSPrivate *priv = gnt_ws_get_instance_private(ws); + priv->name = g_strdup(name ? name : "(noname)"); -const char * gnt_ws_get_name(GntWS *ws)
+gnt_ws_get_name(GntWS *ws)
+ GntWSPrivate *priv = NULL; + g_return_val_if_fail(GNT_IS_WS(ws), NULL); + priv = gnt_ws_get_instance_private(ws);