diff options
author | Karoly Lorentey <[email protected]> | 2004-11-22 11:06:39 +0000 |
---|---|---|
committer | Karoly Lorentey <[email protected]> | 2004-11-22 11:06:39 +0000 |
commit | 71925ac335f7c3b1fd97fba98cb5b9b4f03a6e23 (patch) | |
tree | 63f61c3bebc83c114c16f31dd4ac2b9c0fe17c7d /src/window.c | |
parent | e417405015c93c81641f5c4a33ec898b5c353772 (diff) | |
parent | 83aebfe62204109f19ef7dcca5429c1ddad21c57 (diff) |
Merged in changes from CVS trunk.
Patches applied:
* [email protected]/emacs--cvs-trunk--0--patch-694
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-695
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-696
Merge from gnus--rel--5.10
* [email protected]/emacs--cvs-trunk--0--patch-697
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-698
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-699
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-700
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-701
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-702
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-703
Merge from gnus--rel--5.10
* [email protected]/emacs--cvs-trunk--0--patch-704
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-705
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-706
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-707
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-708
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-709
Update from CVS: src/indent.c (Fvertical_motion): Fix last change.
* [email protected]/emacs--cvs-trunk--0--patch-710
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-711
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-712
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-713
Update from CVS
* [email protected]/gnus--rel--5.10--patch-72
Update from CVS
* [email protected]/gnus--rel--5.10--patch-73
Merge from emacs--cvs-trunk--0
git-archimport-id: [email protected]/emacs--multi-tty--0--patch-268
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c index be5e9167d6..b202031878 100644 --- a/src/window.c +++ b/src/window.c @@ -243,7 +243,8 @@ make_window () register struct window *p; p = allocate_window (); - XSETFASTINT (p->sequence_number, ++sequence_number); + ++sequence_number; + XSETFASTINT (p->sequence_number, sequence_number); XSETFASTINT (p->left_col, 0); XSETFASTINT (p->top_line, 0); XSETFASTINT (p->total_lines, 0); @@ -2659,6 +2660,9 @@ shrink_windows (total, size, nchildren, shrinkable, --shrinkable; total_removed += smallest; + /* We don't know what the smallest is now. */ + smallest = total; + /* Out of for, just remove one window at the time and check again if we have enough space. */ break; @@ -2683,6 +2687,16 @@ shrink_windows (total, size, nchildren, shrinkable, that are left and still can be shrunk. */ while (total_shrink > total_removed) { + int nonzero_sizes = 0; + int nonzero_idx = -1; + + for (i = 0; i < nchildren; ++i) + if (new_sizes[i] > 0) + { + ++nonzero_sizes; + nonzero_idx = i; + } + for (i = 0; i < nchildren; ++i) if (new_sizes[i] > min_size) { @@ -2693,6 +2707,25 @@ shrink_windows (total, size, nchildren, shrinkable, check again if we have enough space. */ break; } + + + /* Special case, only one window left. */ + if (nonzero_sizes == 1) + break; + } + + /* Any surplus due to rounding, we add to windows that are left. */ + while (total_shrink < total_removed) + { + for (i = 0; i < nchildren; ++i) + { + if (new_sizes[i] != 0 && total_shrink < total_removed) + { + ++new_sizes[i]; + --total_removed; + break; + } + } } return new_sizes; @@ -3119,7 +3152,8 @@ selects the buffer of the selected window before each command. */) w = XWINDOW (window); w->frozen_window_start_p = 0; - XSETFASTINT (w->use_time, ++window_select_count); + ++window_select_count; + XSETFASTINT (w->use_time, window_select_count); if (EQ (window, selected_window)) return window; @@ -3610,7 +3644,8 @@ make_dummy_parent (window) = ((struct Lisp_Vector *)o)->contents[i]; XSETWINDOW (new, p); - XSETFASTINT (p->sequence_number, ++sequence_number); + ++sequence_number; + XSETFASTINT (p->sequence_number, sequence_number); /* Put new into window structure in place of window */ replace_window (window, new); @@ -5852,7 +5887,7 @@ save_window_save (window, vector, i) p = SAVED_WINDOW_N (vector, i); w = XWINDOW (window); - XSETFASTINT (w->temslot, i++); + XSETFASTINT (w->temslot, i); i++; p->window = window; p->buffer = w->buffer; p->left_col = w->left_col; |