diff options
| author | Gerd Moellmann | 2000-10-26 20:38:06 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-10-26 20:38:06 +0000 |
| commit | 8b6d9dc9748568e27f54b641db2247cf365093ef (patch) | |
| tree | dc5423f503c7cf519ed1bc73845461735c741876 /src | |
| parent | f59a34152df56153531e41ae3739c3fd3d2402cb (diff) | |
| download | emacs-8b6d9dc9748568e27f54b641db2247cf365093ef.tar.gz emacs-8b6d9dc9748568e27f54b641db2247cf365093ef.zip | |
(size_window): Compute size difference from sum of old
child window sizes instead of from parent's size.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/window.c | 24 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5f5c7c569cf..f6ba041731c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2000-10-26 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-10-26 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * window.c (size_window): Compute size difference from sum of old | ||
| 4 | child window sizes instead of from parent's size. | ||
| 5 | |||
| 3 | * xdisp.c (pos_visible_p): Change current buffer if necessary. | 6 | * xdisp.c (pos_visible_p): Change current buffer if necessary. |
| 4 | Handle obscured lines at the top of the window. | 7 | Handle obscured lines at the top of the window. |
| 5 | 8 | ||
diff --git a/src/window.c b/src/window.c index 2db5ddd2215..38724e22bbc 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2277,12 +2277,12 @@ size_window (window, size, width_p, nodelete_p) | |||
| 2277 | Preserve it as long as that is at all possible. */ | 2277 | Preserve it as long as that is at all possible. */ |
| 2278 | if (width_p) | 2278 | if (width_p) |
| 2279 | { | 2279 | { |
| 2280 | old_size = XFASTINT (w->width); | 2280 | old_size = XINT (w->width); |
| 2281 | min_size = window_min_width; | 2281 | min_size = window_min_width; |
| 2282 | } | 2282 | } |
| 2283 | else | 2283 | else |
| 2284 | { | 2284 | { |
| 2285 | old_size = XFASTINT (w->height); | 2285 | old_size = XINT (w->height); |
| 2286 | min_size = window_min_height; | 2286 | min_size = window_min_height; |
| 2287 | } | 2287 | } |
| 2288 | 2288 | ||
| @@ -2341,18 +2341,22 @@ size_window (window, size, width_p, nodelete_p) | |||
| 2341 | { | 2341 | { |
| 2342 | int fixed_size, each, extra, n; | 2342 | int fixed_size, each, extra, n; |
| 2343 | int resize_fixed_p, nfixed; | 2343 | int resize_fixed_p, nfixed; |
| 2344 | int last_pos, first_pos, nchildren; | 2344 | int last_pos, first_pos, nchildren, total; |
| 2345 | 2345 | ||
| 2346 | /* Determine the fixed-size portion of the this window, and the | 2346 | /* Determine the fixed-size portion of the this window, and the |
| 2347 | number of child windows. */ | 2347 | number of child windows. */ |
| 2348 | fixed_size = nchildren = nfixed = 0; | 2348 | fixed_size = nchildren = nfixed = total = 0; |
| 2349 | for (child = *forward; !NILP (child); child = c->next, ++nchildren) | 2349 | for (child = *forward; !NILP (child); child = c->next, ++nchildren) |
| 2350 | { | 2350 | { |
| 2351 | int child_size; | ||
| 2352 | |||
| 2351 | c = XWINDOW (child); | 2353 | c = XWINDOW (child); |
| 2354 | child_size = width_p ? XINT (c->width) : XINT (c->height); | ||
| 2355 | total += child_size; | ||
| 2356 | |||
| 2352 | if (window_fixed_size_p (c, width_p, 0)) | 2357 | if (window_fixed_size_p (c, width_p, 0)) |
| 2353 | { | 2358 | { |
| 2354 | fixed_size += (width_p | 2359 | fixed_size += child_size; |
| 2355 | ? XFASTINT (c->width) : XFASTINT (c->height)); | ||
| 2356 | ++nfixed; | 2360 | ++nfixed; |
| 2357 | } | 2361 | } |
| 2358 | } | 2362 | } |
| @@ -2365,11 +2369,11 @@ size_window (window, size, width_p, nodelete_p) | |||
| 2365 | /* Compute how many lines/columns to add to each child. The | 2369 | /* Compute how many lines/columns to add to each child. The |
| 2366 | value of extra takes care of rounding errors. */ | 2370 | value of extra takes care of rounding errors. */ |
| 2367 | n = resize_fixed_p ? nchildren : nchildren - nfixed; | 2371 | n = resize_fixed_p ? nchildren : nchildren - nfixed; |
| 2368 | each = (size - old_size) / n; | 2372 | each = (size - total) / n; |
| 2369 | extra = (size - old_size) - n * each; | 2373 | extra = (size - total) - n * each; |
| 2370 | 2374 | ||
| 2371 | /* Compute new children heights and edge positions. */ | 2375 | /* Compute new children heights and edge positions. */ |
| 2372 | first_pos = width_p ? XFASTINT (w->left) : XFASTINT (w->top); | 2376 | first_pos = width_p ? XINT (w->left) : XINT (w->top); |
| 2373 | last_pos = first_pos; | 2377 | last_pos = first_pos; |
| 2374 | for (child = *forward; !NILP (child); child = c->next) | 2378 | for (child = *forward; !NILP (child); child = c->next) |
| 2375 | { | 2379 | { |
| @@ -2412,7 +2416,7 @@ size_window (window, size, width_p, nodelete_p) | |||
| 2412 | { | 2416 | { |
| 2413 | int child_size; | 2417 | int child_size; |
| 2414 | c = XWINDOW (child); | 2418 | c = XWINDOW (child); |
| 2415 | child_size = width_p ? XFASTINT (c->width) : XFASTINT (c->height); | 2419 | child_size = width_p ? XINT (c->width) : XINT (c->height); |
| 2416 | size_window (child, child_size, width_p, 0); | 2420 | size_window (child, child_size, width_p, 0); |
| 2417 | } | 2421 | } |
| 2418 | } | 2422 | } |