# HG changeset patch # User Richard M. Stallman # Date 806703003 0 # Node ID 5beb1d2be5c1b04e539154cd93cbfc0a5da3352a # Parent 3469b31941646954d06bbdcfaea4ee2bd2038413 (x_menubar_window_to_frame): New function. diff -r 3469b3194164 -r 5beb1d2be5c1 src/xfns.c --- a/src/xfns.c Tue Jul 25 19:57:02 1995 +0000 +++ b/src/xfns.c Tue Jul 25 20:10:03 1995 +0000 @@ -358,6 +358,33 @@ return 0; } +/* Likewise, but consider only the menu bar widget. */ + +struct frame * +x_menubar_window_to_frame (dpyinfo, wdesc) + struct x_display_info *dpyinfo; + int wdesc; +{ + Lisp_Object tail, frame; + struct frame *f; + struct x_display *x; + + for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) + { + frame = XCONS (tail)->car; + if (!GC_FRAMEP (frame)) + continue; + f = XFRAME (frame); + if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) + continue; + x = f->display.x; + /* Match if the window is this frame's menubar. */ + if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) + return f; + } + return 0; +} + /* Return the frame whose principal (outermost) window is WDESC. If WDESC is some other (smaller) window, we return 0. */