Commit fd3a3022 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(x_menubar_window_to_frame): New function.

parent 8449a569
......@@ -358,6 +358,33 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc)
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))
f = XFRAME (frame);
if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
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. */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment