Openbox: don't include 'command' in list of available options, it's LXHotkeyApp:...
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 30 Oct 2016 21:36:51 +0000 (23:36 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 30 Oct 2016 21:36:51 +0000 (23:36 +0200)
Also fix illegal access in GTK+ plugin.

plugins/gtk/edit.c
plugins/openbox/openbox.c

index 47522a3..5ac35ec 100644 (file)
@@ -803,9 +803,6 @@ void _edit_action(PluginData *data, GError **error)
                                                 "text", 1, NULL);
     gtk_tree_view_set_headers_visible(data->edit_tree, FALSE);
     //FIXME: connect "row-activated" for Edit
-    g_signal_connect(gtk_tree_view_get_selection(data->edit_tree), "changed",
-                     G_CALLBACK(on_selection_changed), data);
-    update_options_tree(data);
 
     /* frame with fields for editing, hidden for now */
     data->edit_frame = gtk_frame_new(_("Add action"));
@@ -885,6 +882,9 @@ void _edit_action(PluginData *data, GError **error)
         gtk_action_set_visible(act, FALSE);
     }
     gtk_container_add(GTK_CONTAINER(data->edit_window), GTK_WIDGET(vbox));
+    g_signal_connect(gtk_tree_view_get_selection(data->edit_tree), "changed",
+                     G_CALLBACK(on_selection_changed), data);
+    update_options_tree(data);
     update_edit_toolbar(data);
     gtk_window_present(data->edit_window);
     gtk_widget_grab_focus(GTK_WIDGET(data->edit_tree));
index a124bae..4a9f78d 100644 (file)
@@ -1356,7 +1356,20 @@ static GList *obcfg_get_wm_actions(gpointer config, GError **error)
 static GList *obcfg_get_app_options(gpointer config, GError **error)
 {
     if (!available_wm_actions)
+    {
+        GList *l, *opts = NULL;
+        LXHotkeyAttr *opt;
+
         available_wm_actions = convert_options(list_actions);
+        for (l = available_app_options; l; l = l->next)
+        {
+            opt = l->data;
+            if (strcmp(opt->name, "command") != 0)
+                /* remove exec line from available options, it's App->exec */
+                opts = g_list_prepend(opts, l->data);
+        }
+        available_app_options = g_list_reverse(opts);
+    }
     return available_app_options;
 }