diff options
| author | Richard M. Stallman <rms@gnu.org> | 1995-07-25 20:10:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1995-07-25 20:10:03 +0000 |
| commit | fd3a302261f7250696b177cc7cacfd6d729583f7 (patch) | |
| tree | 0c1f0840a575609d67e9ee48f0defba9df61f310 /src | |
| parent | 8449a569e14065e098af1933832c1570b7d7d244 (diff) | |
| download | emacs-fd3a302261f7250696b177cc7cacfd6d729583f7.tar.gz | |
(x_menubar_window_to_frame): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c index 6ad4ed9683c..235d6027e29 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -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)) + 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. */ |
