--- a/gntstyle.c Fri May 10 02:39:07 2019 -0400
+++ b/gntstyle.c Fri May 10 02:49:35 2019 -0400
@@ -28,6 +28,8 @@
+#include "gntwmprivate.h" @@ -188,15 +190,17 @@
titles = g_key_file_get_string_list(gkfile, group, "window-names", &c, NULL);
- for (j = 0; j < c; ++j)
- g_hash_table_replace(wm->name_places, g_strdup(titles[j]), ws);
+ for (j = 0; j < c; ++j) { + gnt_wm_set_place_by_name(wm, titles[j], ws); titles = g_key_file_get_string_list(gkfile, group, "window-titles", &c, NULL);
- for (j = 0; j < c; ++j)
- g_hash_table_replace(wm->title_places, g_strdup(titles[j]), ws);
+ for (j = 0; j < c; ++j) { + gnt_wm_set_place_by_title(wm, titles[j], ws); --- a/gntwm.c Fri May 10 02:39:07 2019 -0400
+++ b/gntwm.c Fri May 10 02:49:35 2019 -0400
@@ -86,6 +86,9 @@
GntListWindow *windows; /* Window-list window */
GntListWindow *actions; /* Action-list window */
+ GHashTable *name_places; /* window name -> ws */ + GHashTable *title_places; /* window title -> ws */ GList *acts; /* List of actions */
/* Currently active menu. There can be at most one menu at a time on
@@ -430,8 +433,10 @@
GntWMPrivate *priv = gnt_wm_get_instance_private(wm);
- wm->name_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
- wm->title_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+ g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); gnt_style_read_workspaces(wm);
if (priv->workspaces == NULL) {
priv->cws = gnt_ws_new("default");
@@ -1896,14 +1901,14 @@
const gchar *name, *title;
title = gnt_box_get_title(GNT_BOX(widget));
- ret = g_hash_table_find(wm->title_places, (GHRFunc)match_title,
+ ret = g_hash_table_find(priv->title_places, + (GHRFunc)match_title, (gpointer)title); name = gnt_widget_get_name(widget);
- ret = g_hash_table_find(wm->name_places, (GHRFunc)match_title,
+ ret = g_hash_table_find(priv->name_places, (GHRFunc)match_title, return ret ? ret : priv->cws;
@@ -2436,6 +2441,30 @@
+gnt_wm_set_place_by_name(GntWM *wm, const gchar *name, GntWS *ws) + GntWMPrivate *priv = NULL; + g_return_if_fail(GNT_IS_WM(wm)); + priv = gnt_wm_get_instance_private(wm); + g_hash_table_replace(priv->name_places, g_strdup(name), ws); +gnt_wm_set_place_by_title(GntWM *wm, const gchar *title, GntWS *ws) + GntWMPrivate *priv = NULL; + g_return_if_fail(GNT_IS_WM(wm)); + priv = gnt_wm_get_instance_private(wm); + g_hash_table_replace(priv->title_places, g_strdup(title), ws); gnt_wm_add_action(GntWM *wm, GntAction *action)
GntWMPrivate *priv = NULL;
--- a/gntwm.h Fri May 10 02:39:07 2019 -0400
+++ b/gntwm.h Fri May 10 02:49:35 2019 -0400
@@ -87,8 +87,6 @@
GHashTable *GNTSEAL(nodes); /* GntWidget -> GntNode */
- GHashTable *GNTSEAL(name_places); /* window name -> ws*/
- GHashTable *GNTSEAL(title_places); /* window title -> ws */
GHashTable *GNTSEAL(positions);
--- a/gntwmprivate.h Fri May 10 02:39:07 2019 -0400
+++ b/gntwmprivate.h Fri May 10 02:49:35 2019 -0400
@@ -52,6 +52,9 @@
gboolean gnt_wm_is_list_window(GntWM *wm, GntWidget *widget);
+void gnt_wm_set_place_by_name(GntWM *wm, const gchar *name, GntWS *ws); +void gnt_wm_set_place_by_title(GntWM *wm, const gchar *title, GntWS *ws); void gnt_wm_add_action(GntWM *wm, GntAction *action);
GntMenu *gnt_wm_get_menu(GntWM *wm);