comparison src/window.c @ 42816:3ba600a336b4

(enlarge_window): When exceeding size of parent, directly delete all the siblings instead of trying to resize it.
author Richard M. Stallman <rms@gnu.org>
date Fri, 18 Jan 2002 03:50:15 +0000
parents 37c66e967beb
children ca273f84f170
comparison
equal deleted inserted replaced
42815:b672e0acf1a3 42816:3ba600a336b4
3541 else 3541 else
3542 { 3542 {
3543 register int delta1; 3543 register int delta1;
3544 register int opht = (*sizefun) (parent); 3544 register int opht = (*sizefun) (parent);
3545 3545
3546 /* If trying to grow this window to or beyond size of the parent,
3547 make delta1 so big that, on shrinking back down,
3548 all the siblings end up with less than one line and are deleted. */
3549 if (opht <= XINT (*sizep) + delta) 3546 if (opht <= XINT (*sizep) + delta)
3550 delta1 = opht * opht * 2; 3547 {
3548 /* If trying to grow this window to or beyond size of the parent,
3549 just delete all the sibling windows. */
3550 Lisp_Object tem, next;
3551
3552 tem = XWINDOW (parent)->vchild;
3553 if (NILP (tem))
3554 tem = XWINDOW (parent)->hchild;
3555
3556 while (! NILP (tem))
3557 {
3558 next = XWINDOW (tem)->next;
3559 if (!EQ (tem, window))
3560 delete_window (tem);
3561 tem = next;
3562 }
3563 }
3551 else 3564 else
3552 { 3565 {
3553 /* Otherwise, make delta1 just right so that if we add 3566 /* Otherwise, make delta1 just right so that if we add
3554 delta1 lines to this window and to the parent, and then 3567 delta1 lines to this window and to the parent, and then
3555 shrink the parent back to its original size, the new 3568 shrink the parent back to its original size, the new
3588 for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) 3601 for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
3589 if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) 3602 if (!window_fixed_size_p (XWINDOW (s), widthflag, 0))
3590 ++n; 3603 ++n;
3591 3604
3592 delta1 = n * delta; 3605 delta1 = n * delta;
3606
3607 /* Add delta1 lines or columns to this window, and to the parent,
3608 keeping things consistent while not affecting siblings. */
3609 XSETINT (CURSIZE (parent), opht + delta1);
3610 (*setsizefun) (window, XINT (*sizep) + delta1, 0);
3611
3612 /* Squeeze out delta1 lines or columns from our parent,
3613 shriking this window and siblings proportionately.
3614 This brings parent back to correct size.
3615 Delta1 was calculated so this makes this window the desired size,
3616 taking it all out of the siblings. */
3617 (*setsizefun) (parent, opht, 0);
3618
3593 } 3619 }
3594
3595 /* Add delta1 lines or columns to this window, and to the parent,
3596 keeping things consistent while not affecting siblings. */
3597 XSETINT (CURSIZE (parent), opht + delta1);
3598 (*setsizefun) (window, XINT (*sizep) + delta1, 0);
3599
3600 /* Squeeze out delta1 lines or columns from our parent,
3601 shriking this window and siblings proportionately.
3602 This brings parent back to correct size.
3603 Delta1 was calculated so this makes this window the desired size,
3604 taking it all out of the siblings. */
3605 (*setsizefun) (parent, opht, 0);
3606 } 3620 }
3607 3621
3608 XSETFASTINT (p->last_modified, 0); 3622 XSETFASTINT (p->last_modified, 0);
3609 XSETFASTINT (p->last_overlay_modified, 0); 3623 XSETFASTINT (p->last_overlay_modified, 0);
3610 3624