mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-21 05:21:37 -07:00
(free_frame_menubar) [USE_MOTIF]: If the shell widget's
x/y position is (0, 0) after destroying the menu bar, restore its original position.
This commit is contained in:
parent
4bde0ebb8d
commit
aba253484f
2 changed files with 29 additions and 0 deletions
|
|
@ -1,5 +1,9 @@
|
|||
2001-03-27 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* xmenu.c (free_frame_menubar) [USE_MOTIF]: If the shell widget's
|
||||
x/y position is (0, 0) after destroying the menu bar, restore
|
||||
its original position.
|
||||
|
||||
* xdisp.c (in_ellipses_for_invisible_text_p): New function.
|
||||
(init_from_display_pos): Use it.
|
||||
(try_window_reusing_current_matrix): Don't use cursor_row_p.
|
||||
|
|
|
|||
25
src/xmenu.c
25
src/xmenu.c
|
|
@ -1854,6 +1854,7 @@ initialize_frame_menubar (f)
|
|||
set_frame_menubar (f, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/* Get rid of the menu bar of frame F, and free its storage.
|
||||
This is used when deleting a frame, and when turning off the menu bar. */
|
||||
|
||||
|
|
@ -1869,9 +1870,33 @@ free_frame_menubar (f)
|
|||
|
||||
if (menubar_widget)
|
||||
{
|
||||
#ifdef USE_MOTIF
|
||||
/* Removing the menu bar magically changes the shell widget's x
|
||||
and y position of (0, 0) which, when the menu bar is turned
|
||||
on again, leads to pull-down menuss appearing in strange
|
||||
positions near the upper-left corner of the display. This
|
||||
happens only with some window managers like twm and ctwm,
|
||||
but not with other like Motif's mwm or kwm, because the
|
||||
latter generate ConfigureNotify events when the menu bar
|
||||
is switched off, which fixes the shell position. */
|
||||
Position x0, y0, x1, y1;
|
||||
#endif
|
||||
|
||||
BLOCK_INPUT;
|
||||
|
||||
#ifdef USE_MOTIF
|
||||
XtVaGetValues (f->output_data.x->widget, XtNx, &x0, XtNy, &y0, NULL);
|
||||
#endif
|
||||
|
||||
lw_destroy_all_widgets ((LWLIB_ID) f->output_data.x->id);
|
||||
f->output_data.x->menubar_widget = NULL;
|
||||
|
||||
#ifdef USE_MOTIF
|
||||
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
|
||||
|
||||
UNBLOCK_INPUT;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue