mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-30 02:02:38 -07:00
(Fx_create_frame): Adjust the frame's height for presence
of the tool bar before calling x_figure_window_size.
This commit is contained in:
parent
f84ff02c81
commit
35f59f6b57
2 changed files with 33 additions and 28 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2001-03-01 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* xfns.c (Fx_create_frame): Adjust the frame's height for presence
|
||||
of the tool bar before calling x_figure_window_size.
|
||||
|
||||
* xmenu.c (free_frame_menubar): Set the frame's menubar_widget to
|
||||
NULL after destroying it, otherwise XTread_socket can access a
|
||||
destroyed widget when input is unblocked.
|
||||
|
|
|
|||
58
src/xfns.c
58
src/xfns.c
|
|
@ -4312,6 +4312,36 @@ This function is an internal primitive--use `make-frame' instead.")
|
|||
"title", "Title", RES_TYPE_STRING);
|
||||
|
||||
f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
|
||||
|
||||
/* Add the tool-bar height to the initial frame height so that the
|
||||
user gets a text display area of the size he specified with -g or
|
||||
via .Xdefaults. Later changes of the tool-bar height don't
|
||||
change the frame size. This is done so that users can create
|
||||
tall Emacs frames without having to guess how tall the tool-bar
|
||||
will get. */
|
||||
if (FRAME_TOOL_BAR_LINES (f))
|
||||
{
|
||||
int margin, relief, bar_height;
|
||||
|
||||
relief = (tool_bar_button_relief > 0
|
||||
? tool_bar_button_relief
|
||||
: DEFAULT_TOOL_BAR_BUTTON_RELIEF);
|
||||
|
||||
if (INTEGERP (Vtool_bar_button_margin)
|
||||
&& XINT (Vtool_bar_button_margin) > 0)
|
||||
margin = XFASTINT (Vtool_bar_button_margin);
|
||||
else if (CONSP (Vtool_bar_button_margin)
|
||||
&& INTEGERP (XCDR (Vtool_bar_button_margin))
|
||||
&& XINT (XCDR (Vtool_bar_button_margin)) > 0)
|
||||
margin = XFASTINT (XCDR (Vtool_bar_button_margin));
|
||||
else
|
||||
margin = 0;
|
||||
|
||||
bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
|
||||
f->height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f);
|
||||
}
|
||||
|
||||
/* Compute the size of the X window. */
|
||||
window_prompting = x_figure_window_size (f, parms);
|
||||
|
||||
if (window_prompting & XNegative)
|
||||
|
|
@ -4369,34 +4399,6 @@ This function is an internal primitive--use `make-frame' instead.")
|
|||
width = f->width;
|
||||
height = f->height;
|
||||
|
||||
/* Add the tool-bar height to the initial frame height so that the
|
||||
user gets a text display area of the size he specified with -g or
|
||||
via .Xdefaults. Later changes of the tool-bar height don't
|
||||
change the frame size. This is done so that users can create
|
||||
tall Emacs frames without having to guess how tall the tool-bar
|
||||
will get. */
|
||||
if (FRAME_TOOL_BAR_LINES (f))
|
||||
{
|
||||
int margin, relief, bar_height;
|
||||
|
||||
relief = (tool_bar_button_relief > 0
|
||||
? tool_bar_button_relief
|
||||
: DEFAULT_TOOL_BAR_BUTTON_RELIEF);
|
||||
|
||||
if (INTEGERP (Vtool_bar_button_margin)
|
||||
&& XINT (Vtool_bar_button_margin) > 0)
|
||||
margin = XFASTINT (Vtool_bar_button_margin);
|
||||
else if (CONSP (Vtool_bar_button_margin)
|
||||
&& INTEGERP (XCDR (Vtool_bar_button_margin))
|
||||
&& XINT (XCDR (Vtool_bar_button_margin)) > 0)
|
||||
margin = XFASTINT (XCDR (Vtool_bar_button_margin));
|
||||
else
|
||||
margin = 0;
|
||||
|
||||
bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
|
||||
height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f);
|
||||
}
|
||||
|
||||
f->height = 0;
|
||||
SET_FRAME_WIDTH (f, 0);
|
||||
change_frame_size (f, height, width, 1, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue