aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv <[email protected]>2005-02-07 21:31:28 +0000
committerJan Djärv <[email protected]>2005-02-07 21:31:28 +0000
commitcaacfeb891addc51922527d6d83f5e558659fa40 (patch)
tree6c6c56545f3d60d21beb9a69508d5cfcc536d2ff /src
parent009bb5d21902505f197bf6fc9c5bca7dab23a4ba (diff)
(x_set_tool_bar_lines): Check that width and height is greater than
zero before clearing area.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c
index bf1b0273a0..c126d6ad36 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1398,10 +1398,14 @@ x_set_tool_bar_lines (f, value, oldval)
int width = FRAME_PIXEL_WIDTH (f);
int y = nlines * FRAME_LINE_HEIGHT (f);
- BLOCK_INPUT;
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- 0, y, width, height, False);
- UNBLOCK_INPUT;
+ /* height can be zero here. */
+ if (height > 0 && width > 0)
+ {
+ BLOCK_INPUT;
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ 0, y, width, height, False);
+ UNBLOCK_INPUT;
+ }
if (WINDOWP (f->tool_bar_window))
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);