diff options
| author | Gerd Moellmann | 2001-01-30 15:05:04 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-30 15:05:04 +0000 |
| commit | 6a1bcd01124b65bf8775a5ff7b5898b53c8d0c1e (patch) | |
| tree | aa7edb4f6dcf665b0c9d6930bbc7c6f7e6c640e7 | |
| parent | cc4cb7559c4e91c908e42d35f095c9a02808f1a3 (diff) | |
| download | emacs-6a1bcd01124b65bf8775a5ff7b5898b53c8d0c1e.tar.gz emacs-6a1bcd01124b65bf8775a5ff7b5898b53c8d0c1e.zip | |
(Fx_create_frame): Add the tool bar height to the frame
height.
| -rw-r--r-- | src/xfns.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/xfns.c b/src/xfns.c index cdc2bb590e2..e8572a33bf3 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4317,14 +4317,7 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 4317 | tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); | 4317 | tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); |
| 4318 | f->no_split = minibuffer_only || EQ (tem, Qt); | 4318 | f->no_split = minibuffer_only || EQ (tem, Qt); |
| 4319 | 4319 | ||
| 4320 | /* Create the X widget or window. Add the tool-bar height to the | 4320 | /* Create the X widget or window. */ |
| 4321 | initial frame height so that the user gets a text display area of | ||
| 4322 | the size he specified with -g or via .Xdefaults. Later changes | ||
| 4323 | of the tool-bar height don't change the frame size. This is done | ||
| 4324 | so that users can create tall Emacs frames without having to | ||
| 4325 | guess how tall the tool-bar will get. */ | ||
| 4326 | f->height += FRAME_TOOL_BAR_LINES (f); | ||
| 4327 | |||
| 4328 | #ifdef USE_X_TOOLKIT | 4321 | #ifdef USE_X_TOOLKIT |
| 4329 | x_window (f, window_prompting, minibuffer_only); | 4322 | x_window (f, window_prompting, minibuffer_only); |
| 4330 | #else | 4323 | #else |
| @@ -4358,6 +4351,35 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 4358 | f->height. */ | 4351 | f->height. */ |
| 4359 | width = f->width; | 4352 | width = f->width; |
| 4360 | height = f->height; | 4353 | height = f->height; |
| 4354 | |||
| 4355 | /* Add the tool-bar height to the initial frame height so that the | ||
| 4356 | user gets a text display area of the size he specified with -g or | ||
| 4357 | via .Xdefaults. Later changes of the tool-bar height don't | ||
| 4358 | change the frame size. This is done so that users can create | ||
| 4359 | tall Emacs frames without having to guess how tall the tool-bar | ||
| 4360 | will get. */ | ||
| 4361 | if (FRAME_TOOL_BAR_LINES (f)) | ||
| 4362 | { | ||
| 4363 | int margin, relief, bar_height; | ||
| 4364 | |||
| 4365 | relief = (tool_bar_button_relief > 0 | ||
| 4366 | ? tool_bar_button_relief | ||
| 4367 | : DEFAULT_TOOL_BAR_BUTTON_RELIEF); | ||
| 4368 | |||
| 4369 | if (INTEGERP (Vtool_bar_button_margin) | ||
| 4370 | && XINT (Vtool_bar_button_margin) > 0) | ||
| 4371 | margin = XFASTINT (Vtool_bar_button_margin); | ||
| 4372 | else if (CONSP (Vtool_bar_button_margin) | ||
| 4373 | && INTEGERP (XCDR (Vtool_bar_button_margin)) | ||
| 4374 | && XINT (XCDR (Vtool_bar_button_margin)) > 0) | ||
| 4375 | margin = XFASTINT (XCDR (Vtool_bar_button_margin)); | ||
| 4376 | else | ||
| 4377 | margin = 0; | ||
| 4378 | |||
| 4379 | bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief; | ||
| 4380 | height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f); | ||
| 4381 | } | ||
| 4382 | |||
| 4361 | f->height = 0; | 4383 | f->height = 0; |
| 4362 | SET_FRAME_WIDTH (f, 0); | 4384 | SET_FRAME_WIDTH (f, 0); |
| 4363 | change_frame_size (f, height, width, 1, 0, 0); | 4385 | change_frame_size (f, height, width, 1, 0, 0); |