/* they're forcing us smaller than minimum size.. */
len = format_real_length(tmpstr, item->size);
tmpstr[len] = '\0';
+ } else {
+ /* make sure the str is big enough to fill the
+ requested size, so it won't corrupt screen */
+ len = format_get_length(tmpstr);
+ if (len < item->size) {
+ char *fill;
+
+ len = item->size-len;
+ fill = g_malloc(len + 1);
+ memset(fill, ' ', len); fill[len] = '\0';
+
+ tmpstr2 = g_strconcat(tmpstr, fill, NULL);
+ g_free(fill);
+ g_free(tmpstr);
+ tmpstr = tmpstr2;
+ }
}
tmpstr2 = update_statusbar_bg(tmpstr, item->bar->color);
func = NULL;
break;
}
- if (func != NULL)
- signal_add_to_id(MODULE_NAME, 1, *pos, func);
+ if (func != NULL) {
+ signal_add_full_id(MODULE_NAME,
+ SIGNAL_PRIORITY_DEFAULT,
+ *pos, func, NULL);
+ }
}
if (g_slist_find(list, item) == NULL)
static void statusbar_signal_remove(int signal_id)
{
- signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_item);
- signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_server);
- signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window);
- signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window_item);
+ signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_item, NULL);
+ signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_server, NULL);
+ signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window, NULL);
+ signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window_item, NULL);
}
static void statusbar_item_remove_signal(SBAR_ITEM_REC *item, int signal_id)