aboutsummaryrefslogtreecommitdiffstats
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorGerd Moellmann2001-03-27 14:41:03 +0000
committerGerd Moellmann2001-03-27 14:41:03 +0000
commitaba253484f6749ca14e996045c25a4f2d38c299a (patch)
tree951795b58055b37bfdd522509853c707ef3a0ecc /src/xmenu.c
parent4bde0ebb8d4d97617b74ac9963adb6df8d6e3505 (diff)
downloademacs-aba253484f6749ca14e996045c25a4f2d38c299a.tar.gz
emacs-aba253484f6749ca14e996045c25a4f2d38c299a.zip
(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.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 6c212da7ffa..99f5c46a959 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1854,6 +1854,7 @@ initialize_frame_menubar (f)
1854 set_frame_menubar (f, 1, 1); 1854 set_frame_menubar (f, 1, 1);
1855} 1855}
1856 1856
1857
1857/* Get rid of the menu bar of frame F, and free its storage. 1858/* Get rid of the menu bar of frame F, and free its storage.
1858 This is used when deleting a frame, and when turning off the menu bar. */ 1859 This is used when deleting a frame, and when turning off the menu bar. */
1859 1860
@@ -1869,9 +1870,33 @@ free_frame_menubar (f)
1869 1870
1870 if (menubar_widget) 1871 if (menubar_widget)
1871 { 1872 {
1873#ifdef USE_MOTIF
1874 /* Removing the menu bar magically changes the shell widget's x
1875 and y position of (0, 0) which, when the menu bar is turned
1876 on again, leads to pull-down menuss appearing in strange
1877 positions near the upper-left corner of the display. This
1878 happens only with some window managers like twm and ctwm,
1879 but not with other like Motif's mwm or kwm, because the
1880 latter generate ConfigureNotify events when the menu bar
1881 is switched off, which fixes the shell position. */
1882 Position x0, y0, x1, y1;
1883#endif
1884
1872 BLOCK_INPUT; 1885 BLOCK_INPUT;
1886
1887#ifdef USE_MOTIF
1888 XtVaGetValues (f->output_data.x->widget, XtNx, &x0, XtNy, &y0, NULL);
1889#endif
1890
1873 lw_destroy_all_widgets ((LWLIB_ID) f->output_data.x->id); 1891 lw_destroy_all_widgets ((LWLIB_ID) f->output_data.x->id);
1874 f->output_data.x->menubar_widget = NULL; 1892 f->output_data.x->menubar_widget = NULL;
1893
1894#ifdef USE_MOTIF
1895 XtVaGetValues (f->output_data.x->widget, XtNx, &x1, XtNy, &y1, NULL);
1896 if (x1 == 0 && y1 == 0)
1897 XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL);
1898#endif
1899
1875 UNBLOCK_INPUT; 1900 UNBLOCK_INPUT;
1876 } 1901 }
1877} 1902}