aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2000-11-24 20:43:51 +0000
committerJason Rumney2000-11-24 20:43:51 +0000
commit36f8209a8757a1b1f25a7ac26e2b9479501ffbb0 (patch)
treea6805c2d79a897ce05363743400378d1886432fb /src
parent2be8f1844877025da964cc34a38b191eaf4b63c5 (diff)
downloademacs-36f8209a8757a1b1f25a7ac26e2b9479501ffbb0.tar.gz
emacs-36f8209a8757a1b1f25a7ac26e2b9479501ffbb0.zip
(x_set_tool_bar_lines): Clear internal border when making tool bar
smaller. When clearing the frame, also clear current matrices. Clear frame when tool bar disappears. Don't use more lines for the tool-bar than is available.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c48
1 files changed, 45 insertions, 3 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 4ff6065ef60..a3f5d8bf0ac 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2522,7 +2522,8 @@ x_set_tool_bar_lines (f, value, oldval)
2522 struct frame *f; 2522 struct frame *f;
2523 Lisp_Object value, oldval; 2523 Lisp_Object value, oldval;
2524{ 2524{
2525 int delta, nlines; 2525 int delta, nlines, root_height;
2526 Lisp_Object root_window;
2526 2527
2527 /* Use VALUE only if an integer >= 0. */ 2528 /* Use VALUE only if an integer >= 0. */
2528 if (INTEGERP (value) && XINT (value) >= 0) 2529 if (INTEGERP (value) && XINT (value) >= 0)
@@ -2534,10 +2535,51 @@ x_set_tool_bar_lines (f, value, oldval)
2534 ++windows_or_buffers_changed; 2535 ++windows_or_buffers_changed;
2535 2536
2536 delta = nlines - FRAME_TOOL_BAR_LINES (f); 2537 delta = nlines - FRAME_TOOL_BAR_LINES (f);
2538
2539 /* Don't resize the tool-bar to more than we have room for. */
2540 root_window = FRAME_ROOT_WINDOW (f);
2541 root_height = XINT (XWINDOW (root_window)->height);
2542 if (root_height - delta < 1)
2543 {
2544 delta = root_height - 1;
2545 nlines = FRAME_TOOL_BAR_LINES (f) + delta;
2546 }
2547
2537 FRAME_TOOL_BAR_LINES (f) = nlines; 2548 FRAME_TOOL_BAR_LINES (f) = nlines;
2538 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2549 x_change_window_heights (root_window, delta);
2539 do_pending_window_change (0);
2540 adjust_glyphs (f); 2550 adjust_glyphs (f);
2551
2552 /* We also have to make sure that the internal border at the top of
2553 the frame, below the menu bar or tool bar, is redrawn when the
2554 tool bar disappears. This is so because the internal border is
2555 below the tool bar if one is displayed, but is below the menu bar
2556 if there isn't a tool bar. The tool bar draws into the area
2557 below the menu bar. */
2558 if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
2559 {
2560 updating_frame = f;
2561 clear_frame ();
2562 clear_current_matrices (f);
2563 updating_frame = NULL;
2564 }
2565
2566 /* If the tool bar gets smaller, the internal border below it
2567 has to be cleared. It was formerly part of the display
2568 of the larger tool bar, and updating windows won't clear it. */
2569 if (delta < 0)
2570 {
2571 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
2572 int width = PIXEL_WIDTH (f);
2573 int y = nlines * CANON_Y_UNIT (f);
2574
2575 BLOCK_INPUT;
2576 {
2577 HDC hdc = get_frame_dc (f);
2578 w32_clear_area (f, hdc, 0, y, width, height);
2579 release_frame_dc (f, hdc);
2580 }
2581 UNBLOCK_INPUT;
2582 }
2541} 2583}
2542 2584
2543 2585