summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-01-05 11:00:30 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-01-05 11:00:30 +0100
commita421d330bf281875b01436f247c97b1b7284dfbe (patch)
tree15cd3504700f2a8f602b14023ec2c5d29639ac47 /src
parentcd944052efc9dd2c8db9a78081700396417426ba (diff)
downloadweechat-a421d330bf281875b01436f247c97b1b7284dfbe.zip
core: fix refresh of bars when applying layout (bug #37944, bug #37952)
Diffstat (limited to 'src')
-rw-r--r--src/gui/curses/gui-curses-main.c7
-rw-r--r--src/gui/gui-bar-window.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index 822f17013..0816b54e9 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -270,6 +270,13 @@ gui_main_refreshs ()
}
}
+ /* refresh window if needed (if asked during refresh of bars) */
+ if (gui_window_refresh_needed)
+ {
+ gui_window_refresh_screen ((gui_window_refresh_needed > 1) ? 1 : 0);
+ gui_window_refresh_needed = 0;
+ }
+
/* refresh windows if needed */
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c
index c8a2e51e0..712b8f41b 100644
--- a/src/gui/gui-bar-window.c
+++ b/src/gui/gui-bar-window.c
@@ -1139,7 +1139,7 @@ gui_bar_window_get_max_size_in_window (struct t_gui_bar_window *bar_window,
}
}
- return max_size;
+ return (max_size >= 1) ? max_size : -1;
}
/*
@@ -1166,7 +1166,7 @@ gui_bar_window_get_max_size (struct t_gui_bar_window *bar_window,
{
max_size = gui_bar_window_get_max_size_in_window (bar_window,
ptr_window);
- if (max_size < max_size_found)
+ if ((max_size >= 0) && (max_size < max_size_found))
max_size_found = max_size;
}
if (max_size_found == INT_MAX)
@@ -1203,7 +1203,7 @@ gui_bar_window_set_current_size (struct t_gui_bar_window *bar_window,
if (bar_window->current_size != new_size)
{
max_size = gui_bar_window_get_max_size (bar_window, window);
- new_size = (max_size < new_size) ? max_size : new_size;
+ new_size = ((max_size >= 0) && (max_size < new_size)) ? max_size : new_size;
if (bar_window->current_size != new_size)
{
bar_window->current_size = new_size;