diff options
| author | YAMAMOTO Mitsuharu | 2010-01-11 14:19:47 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2010-01-11 14:19:47 +0900 |
| commit | 1df47e3844f79ba5f490096dd6206d50367363ba (patch) | |
| tree | 7009143b03d4fcfeabe82657c051b70b19f37b84 /src | |
| parent | 0419b8d6eb95ba71ead60aed3cad04536da25289 (diff) | |
| download | emacs-1df47e3844f79ba5f490096dd6206d50367363ba.tar.gz emacs-1df47e3844f79ba5f490096dd6206d50367363ba.zip | |
* xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
Clear areas that will not be updated after change of menu bar lines.
Clear the menu bar window's current matrix when the window gets empty.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xfns.c | 38 |
2 files changed, 43 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 60ea0cf622c..cac262b3b2f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-01-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]: | ||
| 4 | Clear areas that will not be updated after change of menu bar lines. | ||
| 5 | Clear the menu bar window's current matrix when the window gets empty. | ||
| 6 | |||
| 1 | 2010-01-09 Chong Yidong <cyd@stupidchicken.com> | 7 | 2010-01-09 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 8 | ||
| 3 | * intervals.h, textprop.c (extend_property_ranges): Return value | 9 | * intervals.h, textprop.c (extend_property_ranges): Return value |
diff --git a/src/xfns.c b/src/xfns.c index db42e005d75..15ada091860 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1317,7 +1317,43 @@ x_set_menu_bar_lines (f, value, oldval) | |||
| 1317 | #else /* not USE_X_TOOLKIT && not USE_GTK */ | 1317 | #else /* not USE_X_TOOLKIT && not USE_GTK */ |
| 1318 | FRAME_MENU_BAR_LINES (f) = nlines; | 1318 | FRAME_MENU_BAR_LINES (f) = nlines; |
| 1319 | change_window_heights (f->root_window, nlines - olines); | 1319 | change_window_heights (f->root_window, nlines - olines); |
| 1320 | #endif /* not USE_X_TOOLKIT */ | 1320 | |
| 1321 | /* If the menu bar height gets changed, the internal border below | ||
| 1322 | the top margin has to be cleared. Also, if the menu bar gets | ||
| 1323 | larger, the area for the added lines has to be cleared except for | ||
| 1324 | the first menu bar line that is to be drawn later. */ | ||
| 1325 | if (nlines != olines) | ||
| 1326 | { | ||
| 1327 | int height = FRAME_INTERNAL_BORDER_WIDTH (f); | ||
| 1328 | int width = FRAME_PIXEL_WIDTH (f); | ||
| 1329 | int y; | ||
| 1330 | |||
| 1331 | /* height can be zero here. */ | ||
| 1332 | if (height > 0 && width > 0) | ||
| 1333 | { | ||
| 1334 | y = FRAME_TOP_MARGIN_HEIGHT (f); | ||
| 1335 | |||
| 1336 | BLOCK_INPUT; | ||
| 1337 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 1338 | 0, y, width, height, False); | ||
| 1339 | UNBLOCK_INPUT; | ||
| 1340 | } | ||
| 1341 | |||
| 1342 | if (nlines > 1 && nlines > olines) | ||
| 1343 | { | ||
| 1344 | y = (olines == 0 ? 1 : olines) * FRAME_LINE_HEIGHT (f); | ||
| 1345 | height = nlines * FRAME_LINE_HEIGHT (f) - y; | ||
| 1346 | |||
| 1347 | BLOCK_INPUT; | ||
| 1348 | x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 1349 | 0, y, width, height, False); | ||
| 1350 | UNBLOCK_INPUT; | ||
| 1351 | } | ||
| 1352 | |||
| 1353 | if (nlines == 0 && WINDOWP (f->menu_bar_window)) | ||
| 1354 | clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); | ||
| 1355 | } | ||
| 1356 | #endif /* not USE_X_TOOLKIT && not USE_GTK */ | ||
| 1321 | adjust_glyphs (f); | 1357 | adjust_glyphs (f); |
| 1322 | } | 1358 | } |
| 1323 | 1359 | ||