summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-12-19 12:58:45 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-12-19 12:58:45 +0100
commitf8983eb6c01ab0618d535c06c61ec5f169a4b88e (patch)
tree8fc96344cdbd1507062ba110a4e8988680395ca6
parentea567c6fd3ff600cc810c3f2332ad5b35ea1d684 (diff)
downloadweechat-f8983eb6c01ab0618d535c06c61ec5f169a4b88e.zip
Fix display of bar items in a root bar (use bar item from plugin of current window)
-rw-r--r--src/gui/gui-bar-item.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index 54c7e2860..e5afb8ade 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -277,6 +277,7 @@ gui_bar_item_get_value (const char *name, struct t_gui_bar *bar,
char *result;
int valid_char, length;
struct t_gui_bar_item *ptr_item;
+ struct t_weechat_plugin *ptr_plugin;
start = NULL;
end = NULL;
@@ -312,10 +313,12 @@ gui_bar_item_get_value (const char *name, struct t_gui_bar *bar,
item_value = NULL;
if (item_name)
{
- ptr_item = gui_bar_item_search_with_plugin ((window && window->buffer) ?
- window->buffer->plugin : NULL,
- 0,
- item_name);
+ ptr_plugin = NULL;
+ if (window && window->buffer)
+ ptr_plugin = window->buffer->plugin;
+ else if (gui_current_window && gui_current_window->buffer)
+ ptr_plugin = gui_current_window->buffer->plugin;
+ ptr_item = gui_bar_item_search_with_plugin (ptr_plugin, 0, item_name);
if (ptr_item && ptr_item->build_callback)
{
item_value = (ptr_item->build_callback) (ptr_item->build_callback_data,