diff options
author | Karl Heuer <kwzh@gnu.org> | 1995-04-29 04:19:13 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1995-04-29 04:19:13 +0000 |
commit | 2956ab884712f624f6d2f1483b4acd093367c57f (patch) | |
tree | be35c24a3c590298bc2de48e8ab6268619a0c979 /src | |
parent | 741a8360b1b8bbbcc765a6e5c985e6e50430cc07 (diff) | |
download | emacs-2956ab884712f624f6d2f1483b4acd093367c57f.tar.gz |
(x_non_menubar_window_to_frame): New function.
Diffstat (limited to 'src')
-rw-r--r-- | src/xfns.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c index bc28b7e8d73..cbead0ce9fa 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -326,6 +326,35 @@ x_any_window_to_frame (dpyinfo, wdesc) return 0; } +/* Likewise, but exclude the menu bar widget. */ + +struct frame * +x_non_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; + /* This frame matches if the window is any of its widgets. */ + if (wdesc == XtWindow (x->widget) + || wdesc == XtWindow (x->column_widget) + || wdesc == XtWindow (x->edit_widget)) + return f; + } + return 0; +} + /* Return the frame whose principal (outermost) window is WDESC. If WDESC is some other (smaller) window, we return 0. */ |