diff options
| author | Jan Djärv | 2005-06-06 10:38:40 +0000 |
|---|---|---|
| committer | Jan Djärv | 2005-06-06 10:38:40 +0000 |
| commit | 5494d7bcdba82b2c33278b8d37fee6b0c9bd14e5 (patch) | |
| tree | 03a28a160a585f5081c53bd25a83d8f6215a1f83 /src | |
| parent | eb78dfb8dd75c2989d0a20c327b6ec4e6e78ce11 (diff) | |
| download | emacs-5494d7bcdba82b2c33278b8d37fee6b0c9bd14e5.tar.gz emacs-5494d7bcdba82b2c33278b8d37fee6b0c9bd14e5.zip | |
* window.c (delete_window): Handle the case where a h/vchild has
a h/vchild.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/window.c | 49 |
2 files changed, 53 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f5bbebbb760..308d55187d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * window.c (delete_window): Handle the case where a h/vchild has | ||
| 4 | a h/vchild. | ||
| 5 | |||
| 1 | 2005-06-05 Eli Zaretskii <eliz@gnu.org> | 6 | 2005-06-05 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the | 8 | * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the |
diff --git a/src/window.c b/src/window.c index faf88c91ffc..4839830b177 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1452,8 +1452,10 @@ delete_window (window) | |||
| 1452 | tem = par->hchild; | 1452 | tem = par->hchild; |
| 1453 | if (NILP (tem)) | 1453 | if (NILP (tem)) |
| 1454 | tem = par->vchild; | 1454 | tem = par->vchild; |
| 1455 | if (NILP (XWINDOW (tem)->next)) | 1455 | if (NILP (XWINDOW (tem)->next)) { |
| 1456 | replace_window (parent, tem); | 1456 | replace_window (parent, tem); |
| 1457 | par = XWINDOW (tem); | ||
| 1458 | } | ||
| 1457 | 1459 | ||
| 1458 | /* Since we may be deleting combination windows, we must make sure that | 1460 | /* Since we may be deleting combination windows, we must make sure that |
| 1459 | not only p but all its children have been marked as deleted. */ | 1461 | not only p but all its children have been marked as deleted. */ |
| @@ -1465,6 +1467,51 @@ delete_window (window) | |||
| 1465 | /* Mark this window as deleted. */ | 1467 | /* Mark this window as deleted. */ |
| 1466 | p->buffer = p->hchild = p->vchild = Qnil; | 1468 | p->buffer = p->hchild = p->vchild = Qnil; |
| 1467 | 1469 | ||
| 1470 | if (! NILP (par->parent)) | ||
| 1471 | par = XWINDOW (par->parent); | ||
| 1472 | |||
| 1473 | /* Check if we have a v/hchild with a v/hchild. In that case remove | ||
| 1474 | one of them. */ | ||
| 1475 | |||
| 1476 | if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild)) | ||
| 1477 | { | ||
| 1478 | p = XWINDOW (par->vchild); | ||
| 1479 | par->vchild = p->vchild; | ||
| 1480 | tem = p->vchild; | ||
| 1481 | } | ||
| 1482 | else if (! NILP (par->hchild) && ! NILP (XWINDOW (par->hchild)->hchild)) | ||
| 1483 | { | ||
| 1484 | p = XWINDOW (par->hchild); | ||
| 1485 | par->hchild = p->hchild; | ||
| 1486 | tem = p->hchild; | ||
| 1487 | } | ||
| 1488 | else | ||
| 1489 | p = 0; | ||
| 1490 | |||
| 1491 | if (p) | ||
| 1492 | { | ||
| 1493 | while (! NILP (tem)) { | ||
| 1494 | XWINDOW (tem)->parent = p->parent; | ||
| 1495 | if (NILP (XWINDOW (tem)->next)) | ||
| 1496 | break; | ||
| 1497 | tem = XWINDOW (tem)->next; | ||
| 1498 | } | ||
| 1499 | if (! NILP (tem)) { | ||
| 1500 | /* The next of the v/hchild we are removing is now the next of the | ||
| 1501 | last child for the v/hchild: | ||
| 1502 | Before v/hchild -> v/hchild -> next1 -> next2 | ||
| 1503 | | | ||
| 1504 | -> next3 | ||
| 1505 | After: v/hchild -> next1 -> next2 -> next3 | ||
| 1506 | */ | ||
| 1507 | XWINDOW (tem)->next = p->next; | ||
| 1508 | if (! NILP (p->next)) | ||
| 1509 | XWINDOW (p->next)->prev = tem; | ||
| 1510 | } | ||
| 1511 | p->next = p->prev = p->vchild = p->hchild = p->buffer = Qnil; | ||
| 1512 | } | ||
| 1513 | |||
| 1514 | |||
| 1468 | /* Adjust glyph matrices. */ | 1515 | /* Adjust glyph matrices. */ |
| 1469 | adjust_glyphs (f); | 1516 | adjust_glyphs (f); |
| 1470 | UNBLOCK_INPUT; | 1517 | UNBLOCK_INPUT; |