summaryrefslogtreecommitdiff
path: root/src/fe-text/mainwindows.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-20 14:30:20 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-20 14:30:20 +0000
commit17f4d6b5de3a2a753091fcea39f63151183b5a30 (patch)
treef049431a12da77fd32ba7ffdd031e7b68c3f1329 /src/fe-text/mainwindows.c
parenta5b32b70a7db8ce41a37d9ee6fdef85300130351 (diff)
downloadirssi-17f4d6b5de3a2a753091fcea39f63151183b5a30.zip
added mainwindow_resize_freeze() and .._thaw() functions to temporarily
freeze all window resizes. It's now being used with statusbar code so changing between split windows don't make the screen jump around. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1860 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/mainwindows.c')
-rw-r--r--src/fe-text/mainwindows.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c
index b2f84217..ee1d7edd 100644
--- a/src/fe-text/mainwindows.c
+++ b/src/fe-text/mainwindows.c
@@ -75,6 +75,12 @@ static void mainwindow_resize_windows(MAIN_WINDOW_REC *window)
{
GSList *tmp;
+ if (window->resize_freeze_counter > 0) {
+ window->resize_needed = TRUE;
+ return;
+ }
+
+ mainwindow_set_screen_size(window);
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data;
@@ -84,6 +90,8 @@ static void mainwindow_resize_windows(MAIN_WINDOW_REC *window)
MAIN_WINDOW_TEXT_HEIGHT(window));
}
}
+
+ signal_emit("mainwindow resized", 1, window);
}
static void mainwindow_resize(MAIN_WINDOW_REC *window, int xdiff, int ydiff)
@@ -93,12 +101,7 @@ static void mainwindow_resize(MAIN_WINDOW_REC *window, int xdiff, int ydiff)
window->width += xdiff;
window->height = window->last_line-window->first_line+1;
- mainwindow_set_screen_size(window);
mainwindow_resize_windows(window);
-
- textbuffer_view_set_window(WINDOW_GUI(window->active)->view,
- window->screen_win);
- signal_emit("mainwindow resized", 1, window);
}
static GSList *get_sticky_windows_sorted(MAIN_WINDOW_REC *mainwin)
@@ -517,14 +520,26 @@ int mainwindow_set_statusbar_lines(MAIN_WINDOW_REC *window,
window->statusbar_lines += bottom;
}
- if (top+bottom != 0) {
- mainwindow_set_screen_size(window);
+ if (top+bottom != 0)
mainwindow_resize_windows(window);
- }
return ret;
}
+void mainwindow_resize_freeze(MAIN_WINDOW_REC *window)
+{
+ window->resize_freeze_counter++;
+}
+
+void mainwindow_resize_thaw(MAIN_WINDOW_REC *window)
+{
+ if (--window->resize_freeze_counter == 0 &&
+ window->resize_needed) {
+ window->resize_needed = FALSE;
+ mainwindow_resize_windows(window);
+ }
+}
+
static void mainwindows_resize_two(MAIN_WINDOW_REC *grow_win,
MAIN_WINDOW_REC *shrink_win, int count)
{