Mercurial > emacs
comparison src/xfns.c @ 108396:842d29bdc9a5
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Wed, 13 Jan 2010 14:05:08 +0000 |
parents | 1d1d5d9bd884 |
children | f12233437424 |
comparison
equal
deleted
inserted
replaced
108395:e36c1160a378 | 108396:842d29bdc9a5 |
---|---|
1 /* Functions for the X window system. | 1 /* Functions for the X window system. |
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | 3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GNU Emacs. | 6 This file is part of GNU Emacs. |
7 | 7 |
8 GNU Emacs is free software: you can redistribute it and/or modify | 8 GNU Emacs is free software: you can redistribute it and/or modify |
1315 f->output_data.x->menubar_widget = 0; | 1315 f->output_data.x->menubar_widget = 0; |
1316 } | 1316 } |
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 |
1324 | 1360 |
1325 /* Set the number of lines used for the tool bar of frame F to VALUE. | 1361 /* Set the number of lines used for the tool bar of frame F to VALUE. |