summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/plugin-api.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index e335dde8c..facda3a10 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -989,18 +989,36 @@ plugin_api_infolist_get (char *name, void *pointer, char *arguments)
}
else
{
- /* build list with all windows */
- for (ptr_window = gui_windows; ptr_window;
- ptr_window = ptr_window->next_window)
+ if (arguments && arguments[0])
{
- if (!plugin_api_infolist_get_add_window (ptr_infolist,
- ptr_window))
+ if ((string_strcasecmp (arguments, "current") == 0)
+ && gui_current_window)
{
- plugin_infolist_free (ptr_infolist);
- return NULL;
+ if (!plugin_api_infolist_get_add_window (ptr_infolist,
+ gui_current_window))
+ {
+ plugin_infolist_free (ptr_infolist);
+ return NULL;
+ }
+ return ptr_infolist;
}
+ return NULL;
+ }
+ else
+ {
+ /* build list with all windows */
+ for (ptr_window = gui_windows; ptr_window;
+ ptr_window = ptr_window->next_window)
+ {
+ if (!plugin_api_infolist_get_add_window (ptr_infolist,
+ ptr_window))
+ {
+ plugin_infolist_free (ptr_infolist);
+ return NULL;
+ }
+ }
+ return ptr_infolist;
}
- return ptr_infolist;
}
}
}