diff options
| author | Gerd Moellmann | 2001-03-01 16:39:11 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-01 16:39:11 +0000 |
| commit | 35f59f6b575dd2e85d65ddb21139b395194694c7 (patch) | |
| tree | cf90ceffe95d9f7c5822faca167b3fac0aedce45 /src | |
| parent | f84ff02c8103b347cea4c17ff46b8bc10b00883e (diff) | |
| download | emacs-35f59f6b575dd2e85d65ddb21139b395194694c7.tar.gz emacs-35f59f6b575dd2e85d65ddb21139b395194694c7.zip | |
(Fx_create_frame): Adjust the frame's height for presence
of the tool bar before calling x_figure_window_size.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/xfns.c | 58 |
2 files changed, 33 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6336902bde3..d40af06c4dd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2001-03-01 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-03-01 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xfns.c (Fx_create_frame): Adjust the frame's height for presence | ||
| 4 | of the tool bar before calling x_figure_window_size. | ||
| 5 | |||
| 3 | * xmenu.c (free_frame_menubar): Set the frame's menubar_widget to | 6 | * xmenu.c (free_frame_menubar): Set the frame's menubar_widget to |
| 4 | NULL after destroying it, otherwise XTread_socket can access a | 7 | NULL after destroying it, otherwise XTread_socket can access a |
| 5 | destroyed widget when input is unblocked. | 8 | destroyed widget when input is unblocked. |
diff --git a/src/xfns.c b/src/xfns.c index 1add97f6599..8ed08ee75ff 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -4312,6 +4312,36 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 4312 | "title", "Title", RES_TYPE_STRING); | 4312 | "title", "Title", RES_TYPE_STRING); |
| 4313 | 4313 | ||
| 4314 | f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; | 4314 | f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
| 4315 | |||
| 4316 | /* Add the tool-bar height to the initial frame height so that the | ||
| 4317 | user gets a text display area of the size he specified with -g or | ||
| 4318 | via .Xdefaults. Later changes of the tool-bar height don't | ||
| 4319 | change the frame size. This is done so that users can create | ||
| 4320 | tall Emacs frames without having to guess how tall the tool-bar | ||
| 4321 | will get. */ | ||
| 4322 | if (FRAME_TOOL_BAR_LINES (f)) | ||
| 4323 | { | ||
| 4324 | int margin, relief, bar_height; | ||
| 4325 | |||
| 4326 | relief = (tool_bar_button_relief > 0 | ||
| 4327 | ? tool_bar_button_relief | ||
| 4328 | : DEFAULT_TOOL_BAR_BUTTON_RELIEF); | ||
| 4329 | |||
| 4330 | if (INTEGERP (Vtool_bar_button_margin) | ||
| 4331 | && XINT (Vtool_bar_button_margin) > 0) | ||
| 4332 | margin = XFASTINT (Vtool_bar_button_margin); | ||
| 4333 | else if (CONSP (Vtool_bar_button_margin) | ||
| 4334 | && INTEGERP (XCDR (Vtool_bar_button_margin)) | ||
| 4335 | && XINT (XCDR (Vtool_bar_button_margin)) > 0) | ||
| 4336 | margin = XFASTINT (XCDR (Vtool_bar_button_margin)); | ||
| 4337 | else | ||
| 4338 | margin = 0; | ||
| 4339 | |||
| 4340 | bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief; | ||
| 4341 | f->height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f); | ||
| 4342 | } | ||
| 4343 | |||
| 4344 | /* Compute the size of the X window. */ | ||
| 4315 | window_prompting = x_figure_window_size (f, parms); | 4345 | window_prompting = x_figure_window_size (f, parms); |
| 4316 | 4346 | ||
| 4317 | if (window_prompting & XNegative) | 4347 | if (window_prompting & XNegative) |
| @@ -4369,34 +4399,6 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 4369 | width = f->width; | 4399 | width = f->width; |
| 4370 | height = f->height; | 4400 | height = f->height; |
| 4371 | 4401 | ||
| 4372 | /* Add the tool-bar height to the initial frame height so that the | ||
| 4373 | user gets a text display area of the size he specified with -g or | ||
| 4374 | via .Xdefaults. Later changes of the tool-bar height don't | ||
| 4375 | change the frame size. This is done so that users can create | ||
| 4376 | tall Emacs frames without having to guess how tall the tool-bar | ||
| 4377 | will get. */ | ||
| 4378 | if (FRAME_TOOL_BAR_LINES (f)) | ||
| 4379 | { | ||
| 4380 | int margin, relief, bar_height; | ||
| 4381 | |||
| 4382 | relief = (tool_bar_button_relief > 0 | ||
| 4383 | ? tool_bar_button_relief | ||
| 4384 | : DEFAULT_TOOL_BAR_BUTTON_RELIEF); | ||
| 4385 | |||
| 4386 | if (INTEGERP (Vtool_bar_button_margin) | ||
| 4387 | && XINT (Vtool_bar_button_margin) > 0) | ||
| 4388 | margin = XFASTINT (Vtool_bar_button_margin); | ||
| 4389 | else if (CONSP (Vtool_bar_button_margin) | ||
| 4390 | && INTEGERP (XCDR (Vtool_bar_button_margin)) | ||
| 4391 | && XINT (XCDR (Vtool_bar_button_margin)) > 0) | ||
| 4392 | margin = XFASTINT (XCDR (Vtool_bar_button_margin)); | ||
| 4393 | else | ||
| 4394 | margin = 0; | ||
| 4395 | |||
| 4396 | bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief; | ||
| 4397 | height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f); | ||
| 4398 | } | ||
| 4399 | |||
| 4400 | f->height = 0; | 4402 | f->height = 0; |
| 4401 | SET_FRAME_WIDTH (f, 0); | 4403 | SET_FRAME_WIDTH (f, 0); |
| 4402 | change_frame_size (f, height, width, 1, 0, 0); | 4404 | change_frame_size (f, height, width, 1, 0, 0); |