/* X Communication module for terminals which understand the X protocol.
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2014 Free Software
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2015 Free Software
Foundation, Inc.
This file is part of GNU Emacs.
xg_update_frame_menubar (f);
#else
struct x_output *x;
-/** int columns, rows; **/
eassert (FRAME_X_P (f));
return;
block_input ();
- /* Save the size of the frame because the pane widget doesn't accept
- to resize itself. So force it. */
-/** columns = FRAME_COLS (f); **/
-/** rows = FRAME_LINES (f); **/
/* Do the voodoo which means "I'm changing lots of things, don't try
to refigure sizes until I'm done." */
XtManageChild (x->edit_widget);
lw_refigure_widget (x->column_widget, True);
- /* Force the pane widget to resize itself with the right values. */
-/** EmacsFrameSetCharSize (x->edit_widget, columns, rows); **/
- adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 2, 0);
+ /* Force the pane widget to resize itself. */
+#ifdef USE_LUCID
+ /* For reasons I don't know Lucid wants to add one pixel to the frame
+ height when adding the menu bar. Compensate that here. */
+ adjust_frame_size (f, -1, FRAME_TEXT_HEIGHT (f) - 1, 2, 0, Qmenu_bar_lines);
+#else
+ adjust_frame_size (f, -1, -1, 2, 0, Qmenu_bar_lines);
+#endif /* USE_LUCID */
unblock_input ();
-#endif
+#endif /* USE_GTK */
}
#ifdef USE_LUCID
f->output_data.x->saved_menu_event->type = 0;
}
-#ifdef USE_GTK
- /* If we have detached menus, we must update deep so detached menus
- also gets updated. */
- deep_p = deep_p || xg_have_tear_offs (f);
-#endif
-
if (deep_p)
{
/* Make a widget-value tree representing the entire menu trees. */
free_frame_menubar (struct frame *f)
{
Widget menubar_widget;
+#ifdef USE_MOTIF
+ /* Motif automatically shrinks the frame in lw_destroy_all_widgets.
+ If we want to preserve the old height, calculate it now so we can
+ restore it below. */
+ int old_height = FRAME_TEXT_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f);
+#endif
eassert (FRAME_X_P (f));
XtVaGetValues (f->output_data.x->widget, XtNx, &x1, XtNy, &y1, NULL);
if (x1 == 0 && y1 == 0)
XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL);
-#endif
- adjust_frame_size (f, FRAME_TEXT_WIDTH (f),
- FRAME_TEXT_HEIGHT (f), 2, 0);
- /*
- if (frame_inhibit_resize (f, 0))
- change_frame_size (f, 0, 0, 0, 0, 0, 1);
+ if (frame_inhibit_resize (f, 0, Qmenu_bar_lines))
+ adjust_frame_size (f, -1, old_height, 1, 0, Qmenu_bar_lines);
else
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
- FRAME_TEXT_HEIGHT (f), 1);
- */
+#endif /* USE_MOTIF */
+ adjust_frame_size (f, -1, -1, 2, 0, Qmenu_bar_lines);
+ }
+ else
+ {
+#ifdef USE_MOTIF
+ if (frame_inhibit_resize (f, 0, Qmenu_bar_lines))
+ adjust_frame_size (f, -1, old_height, 1, 0, Qmenu_bar_lines);
+#endif
}
+
unblock_input ();
}
}