comparison src/xfns.c @ 7040:cd4dd38925f9

(x_window): Test FRAME_EXTERNAL_MENU_BAR to decide on calling initialize_frame_menubar. (x_top_window_to_frame): New function.
author Richard M. Stallman <rms@gnu.org>
date Sat, 23 Apr 1994 04:09:17 +0000
parents 5e194e2529e7
children f9eeb75c2b76
comparison
equal deleted inserted replaced
7039:403172c099fc 7040:cd4dd38925f9
313 && wdesc == XtWindow (x->menubar_widget)) 313 && wdesc == XtWindow (x->menubar_widget))
314 return f; 314 return f;
315 } 315 }
316 return 0; 316 return 0;
317 } 317 }
318
319 /* Return the frame whose principal (outermost) window is WDESC.
320 If WDESC is some other (smaller) window, we return 0. */
321
322 struct frame *
323 x_top_window_to_frame (wdesc)
324 int wdesc;
325 {
326 Lisp_Object tail, frame;
327 struct frame *f;
328 struct x_display *x;
329
330 for (tail = Vframe_list; XGCTYPE (tail) == Lisp_Cons;
331 tail = XCONS (tail)->cdr)
332 {
333 frame = XCONS (tail)->car;
334 if (XGCTYPE (frame) != Lisp_Frame)
335 continue;
336 f = XFRAME (frame);
337 if (f->display.nothing == 1)
338 return 0;
339 x = f->display.x;
340 /* This frame matches if the window is its topmost widget. */
341 if (wdesc == XtWindow (x->widget))
342 return f;
343 /* Match if the window is this frame's menubar. */
344 if (x->menubar_widget
345 && wdesc == XtWindow (x->menubar_widget))
346 return f;
347 }
348 return 0;
349 }
318 #endif /* USE_X_TOOLKIT */ 350 #endif /* USE_X_TOOLKIT */
319 351
320 352
321 /* Connect the frame-parameter names for X frames 353 /* Connect the frame-parameter names for X frames
322 to the ways of passing the parameter values to the window system. 354 to the ways of passing the parameter values to the window system.
1766 panedWidgetClass, 1798 panedWidgetClass,
1767 shell_widget, al, ac); 1799 shell_widget, al, ac);
1768 1800
1769 f->display.x->column_widget = pane_widget; 1801 f->display.x->column_widget = pane_widget;
1770 1802
1771 if (!minibuffer_only && FRAME_MENU_BAR_LINES (f) > 0) 1803 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f))
1772 initialize_frame_menubar (f); 1804 initialize_frame_menubar (f);
1773 1805
1774 /* mappedWhenManaged to false tells to the paned window to not map/unmap 1806 /* mappedWhenManaged to false tells to the paned window to not map/unmap
1775 * the emacs screen when changing menubar. This reduces flickering a lot. 1807 the emacs screen when changing menubar. This reduces flickering. */
1776 */
1777 1808
1778 ac = 0; 1809 ac = 0;
1779 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; 1810 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
1780 XtSetArg (al[ac], XtNshowGrip, 0); ac++; 1811 XtSetArg (al[ac], XtNshowGrip, 0); ac++;
1781 XtSetArg (al[ac], XtNallowResize, 1); ac++; 1812 XtSetArg (al[ac], XtNallowResize, 1); ac++;