--- a/gntmain.c Fri May 10 00:50:32 2019 -0400
+++ b/gntmain.c Fri May 10 01:00:51 2019 -0400
@@ -815,7 +815,7 @@
action->label = g_strdup(label);
action->callback = callback;
- wm->acts = g_list_append(wm->acts, action);
+ gnt_wm_add_action(wm, action); --- a/gntwm.c Fri May 10 00:50:32 2019 -0400
+++ b/gntwm.c Fri May 10 01:00:51 2019 -0400
@@ -82,6 +82,8 @@
GntListWindow *windows; /* Window-list window */
GntListWindow *actions; /* Action-list window */
+ GList *acts; /* List of actions */ @@ -1008,8 +1010,9 @@
+ if (priv->acts == NULL) { priv->actions = &priv->list;
@@ -1022,13 +1025,13 @@
/* XXX: Do we really want this? */
gnt_tree_set_compare_func(GNT_TREE(tree), compare_action);
- for (iter = wm->acts; iter; iter = iter->next) {
+ for (iter = priv->acts; iter; iter = iter->next) { GntAction *action = iter->data;
gnt_tree_add_row_last(GNT_TREE(tree), action,
gnt_tree_create_row(GNT_TREE(tree), action->label), NULL);
g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(action_list_activate), wm);
- n = g_list_length(wm->acts);
+ n = g_list_length(priv->acts); gnt_widget_set_size(tree, 0, n);
gnt_widget_set_position(win, 0, getmaxy(stdscr) - 3 - n);
@@ -2359,6 +2362,18 @@
return priv->list.window == widget;
+gnt_wm_add_action(GntWM *wm, GntAction *action) + GntWMPrivate *priv = NULL; + g_return_if_fail(GNT_IS_WM(wm)); + priv = gnt_wm_get_instance_private(wm); + priv->acts = g_list_append(priv->acts, action); void gnt_wm_set_event_stack(GntWM *wm, gboolean set)
--- a/gntwm.h Fri May 10 00:50:32 2019 -0400
+++ b/gntwm.h Fri May 10 01:00:51 2019 -0400
@@ -85,7 +85,6 @@
- * @acts: List of actions
* @menu: Currently active menu. There can be at most one menu at a time on the
* screen. If there is a menu being displayed, then all the keystrokes
* will be sent to the menu until it is closed, either when the user
@@ -110,8 +109,6 @@
GHashTable *GNTSEAL(name_places); /* window name -> ws*/
GHashTable *GNTSEAL(title_places); /* window title -> ws */
gboolean GNTSEAL(event_stack);
--- a/gntwmprivate.h Fri May 10 00:50:32 2019 -0400
+++ b/gntwmprivate.h Fri May 10 01:00:51 2019 -0400
@@ -40,6 +40,8 @@
gboolean gnt_wm_is_list_window(GntWM *wm, GntWidget *widget);
+void gnt_wm_add_action(GntWM *wm, GntAction *action); #endif /* GNT_WM_PRIVATE_H */