diff options
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 192ed89e2c6..4379cddaf2e 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -636,13 +636,7 @@ update_frame_menubar (struct frame *f) | |||
| 636 | lw_refigure_widget (x->column_widget, True); | 636 | lw_refigure_widget (x->column_widget, True); |
| 637 | 637 | ||
| 638 | /* Force the pane widget to resize itself. */ | 638 | /* Force the pane widget to resize itself. */ |
| 639 | int new_height = -1; | 639 | adjust_frame_size (f, -1, -1, 2, false, Qupdate_frame_menubar); |
| 640 | #ifdef USE_LUCID | ||
| 641 | /* For reasons I don't know Lucid wants to add one pixel to the frame | ||
| 642 | height when adding the menu bar. Compensate that here. */ | ||
| 643 | new_height = FRAME_TEXT_HEIGHT (f) - 1; | ||
| 644 | #endif /* USE_LUCID */ | ||
| 645 | adjust_frame_size (f, -1, new_height, 2, false, Qmenu_bar_lines); | ||
| 646 | unblock_input (); | 640 | unblock_input (); |
| 647 | #endif /* USE_GTK */ | 641 | #endif /* USE_GTK */ |
| 648 | } | 642 | } |
| @@ -979,7 +973,15 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 979 | menubar_size | 973 | menubar_size |
| 980 | = (f->output_data.x->menubar_widget | 974 | = (f->output_data.x->menubar_widget |
| 981 | ? (f->output_data.x->menubar_widget->core.height | 975 | ? (f->output_data.x->menubar_widget->core.height |
| 982 | + f->output_data.x->menubar_widget->core.border_width) | 976 | #ifndef USE_LUCID |
| 977 | /* Damn me... With Lucid I get a core.border_width of 1 | ||
| 978 | only the first time this is called and an ibw of 1 every | ||
| 979 | time this is called. So the first time this is called I | ||
| 980 | was off by one. Fix that here by never adding | ||
| 981 | core.border_width for Lucid. */ | ||
| 982 | + f->output_data.x->menubar_widget->core.border_width | ||
| 983 | #endif /* USE_LUCID */ | ||
| 984 | ) | ||
| 983 | : 0); | 985 | : 0); |
| 984 | 986 | ||
| 985 | #ifdef USE_LUCID | 987 | #ifdef USE_LUCID |
| @@ -990,9 +992,10 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) | |||
| 990 | if (FRAME_EXTERNAL_MENU_BAR (f)) | 992 | if (FRAME_EXTERNAL_MENU_BAR (f)) |
| 991 | { | 993 | { |
| 992 | Dimension ibw = 0; | 994 | Dimension ibw = 0; |
| 995 | |||
| 993 | XtVaGetValues (f->output_data.x->column_widget, | 996 | XtVaGetValues (f->output_data.x->column_widget, |
| 994 | XtNinternalBorderWidth, &ibw, NULL); | 997 | XtNinternalBorderWidth, &ibw, NULL); |
| 995 | menubar_size += ibw; | 998 | menubar_size += ibw; |
| 996 | } | 999 | } |
| 997 | #endif /* USE_LUCID */ | 1000 | #endif /* USE_LUCID */ |
| 998 | 1001 | ||
| @@ -1073,21 +1076,24 @@ free_frame_menubar (struct frame *f) | |||
| 1073 | 1076 | ||
| 1074 | if (f->output_data.x->widget) | 1077 | if (f->output_data.x->widget) |
| 1075 | { | 1078 | { |
| 1076 | int new_height = -1; | ||
| 1077 | #ifdef USE_MOTIF | 1079 | #ifdef USE_MOTIF |
| 1078 | XtVaGetValues (f->output_data.x->widget, XtNx, &x1, XtNy, &y1, NULL); | 1080 | XtVaGetValues (f->output_data.x->widget, XtNx, &x1, XtNy, &y1, NULL); |
| 1079 | if (x1 == 0 && y1 == 0) | 1081 | if (x1 == 0 && y1 == 0) |
| 1080 | XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL); | 1082 | XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL); |
| 1081 | if (frame_inhibit_resize (f, false, Qmenu_bar_lines)) | 1083 | if (frame_inhibit_resize (f, false, Qmenu_bar_lines)) |
| 1082 | new_height = old_height; | 1084 | adjust_frame_size (f, -1, old_height, 1, false, Qfree_frame_menubar_1); |
| 1085 | else | ||
| 1086 | adjust_frame_size (f, -1, -1, 2, false, Qfree_frame_menubar_1); | ||
| 1087 | #else | ||
| 1088 | adjust_frame_size (f, -1, -1, 2, false, Qfree_frame_menubar_1); | ||
| 1083 | #endif /* USE_MOTIF */ | 1089 | #endif /* USE_MOTIF */ |
| 1084 | adjust_frame_size (f, -1, new_height, 2, false, Qmenu_bar_lines); | ||
| 1085 | } | 1090 | } |
| 1086 | else | 1091 | else |
| 1087 | { | 1092 | { |
| 1088 | #ifdef USE_MOTIF | 1093 | #ifdef USE_MOTIF |
| 1089 | if (frame_inhibit_resize (f, false, Qmenu_bar_lines)) | 1094 | if (WINDOWP (FRAME_ROOT_WINDOW (f)) |
| 1090 | adjust_frame_size (f, -1, old_height, 1, false, Qmenu_bar_lines); | 1095 | && frame_inhibit_resize (f, false, Qmenu_bar_lines)) |
| 1096 | adjust_frame_size (f, -1, old_height, 1, false, Qfree_frame_menubar_2); | ||
| 1091 | #endif | 1097 | #endif |
| 1092 | } | 1098 | } |
| 1093 | 1099 | ||