diff options
| author | Karl Heuer | 1995-04-29 04:19:13 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-04-29 04:19:13 +0000 |
| commit | 5fbc3f3a3143118c99aaebeb72716fe80d16fca9 (patch) | |
| tree | 10596c991fa1f014da4daf41dc7a3753c3afdbf1 | |
| parent | 10ceaf03567ec65092e8e48f00ba74cabfe0c7df (diff) | |
| download | emacs-5fbc3f3a3143118c99aaebeb72716fe80d16fca9.tar.gz emacs-5fbc3f3a3143118c99aaebeb72716fe80d16fca9.zip | |
(x_non_menubar_window_to_frame): New function.
| -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) | |||
| 326 | return 0; | 326 | return 0; |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | /* Likewise, but exclude the menu bar widget. */ | ||
| 330 | |||
| 331 | struct frame * | ||
| 332 | x_non_menubar_window_to_frame (dpyinfo, wdesc) | ||
| 333 | struct x_display_info *dpyinfo; | ||
| 334 | int wdesc; | ||
| 335 | { | ||
| 336 | Lisp_Object tail, frame; | ||
| 337 | struct frame *f; | ||
| 338 | struct x_display *x; | ||
| 339 | |||
| 340 | for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) | ||
| 341 | { | ||
| 342 | frame = XCONS (tail)->car; | ||
| 343 | if (!GC_FRAMEP (frame)) | ||
| 344 | continue; | ||
| 345 | f = XFRAME (frame); | ||
| 346 | if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) | ||
| 347 | continue; | ||
| 348 | x = f->display.x; | ||
| 349 | /* This frame matches if the window is any of its widgets. */ | ||
| 350 | if (wdesc == XtWindow (x->widget) | ||
| 351 | || wdesc == XtWindow (x->column_widget) | ||
| 352 | || wdesc == XtWindow (x->edit_widget)) | ||
| 353 | return f; | ||
| 354 | } | ||
| 355 | return 0; | ||
| 356 | } | ||
| 357 | |||
| 329 | /* Return the frame whose principal (outermost) window is WDESC. | 358 | /* Return the frame whose principal (outermost) window is WDESC. |
| 330 | If WDESC is some other (smaller) window, we return 0. */ | 359 | If WDESC is some other (smaller) window, we return 0. */ |
| 331 | 360 | ||