diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/xfns.c b/src/xfns.c index 898f86c3119..cb6255bdd29 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -315,6 +315,38 @@ x_any_window_to_frame (wdesc) | |||
| 315 | } | 315 | } |
| 316 | return 0; | 316 | return 0; |
| 317 | } | 317 | } |
| 318 | |||
| 319 | /* Return the frame whose principal (outermost) window is WDESC. | ||
| 320 | If WDESC is some other (smaller) window, we return 0. */ | ||
| 321 | |||
| 322 | struct frame * | ||
| 323 | x_top_window_to_frame (wdesc) | ||
| 324 | int wdesc; | ||
| 325 | { | ||
| 326 | Lisp_Object tail, frame; | ||
| 327 | struct frame *f; | ||
| 328 | struct x_display *x; | ||
| 329 | |||
| 330 | for (tail = Vframe_list; XGCTYPE (tail) == Lisp_Cons; | ||
| 331 | tail = XCONS (tail)->cdr) | ||
| 332 | { | ||
| 333 | frame = XCONS (tail)->car; | ||
| 334 | if (XGCTYPE (frame) != Lisp_Frame) | ||
| 335 | continue; | ||
| 336 | f = XFRAME (frame); | ||
| 337 | if (f->display.nothing == 1) | ||
| 338 | return 0; | ||
| 339 | x = f->display.x; | ||
| 340 | /* This frame matches if the window is its topmost widget. */ | ||
| 341 | if (wdesc == XtWindow (x->widget)) | ||
| 342 | return f; | ||
| 343 | /* Match if the window is this frame's menubar. */ | ||
| 344 | if (x->menubar_widget | ||
| 345 | && wdesc == XtWindow (x->menubar_widget)) | ||
| 346 | return f; | ||
| 347 | } | ||
| 348 | return 0; | ||
| 349 | } | ||
| 318 | #endif /* USE_X_TOOLKIT */ | 350 | #endif /* USE_X_TOOLKIT */ |
| 319 | 351 | ||
| 320 | 352 | ||
| @@ -1768,12 +1800,11 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 1768 | 1800 | ||
| 1769 | f->display.x->column_widget = pane_widget; | 1801 | f->display.x->column_widget = pane_widget; |
| 1770 | 1802 | ||
| 1771 | if (!minibuffer_only && FRAME_MENU_BAR_LINES (f) > 0) | 1803 | if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) |
| 1772 | initialize_frame_menubar (f); | 1804 | initialize_frame_menubar (f); |
| 1773 | 1805 | ||
| 1774 | /* mappedWhenManaged to false tells to the paned window to not map/unmap | 1806 | /* mappedWhenManaged to false tells to the paned window to not map/unmap |
| 1775 | * the emacs screen when changing menubar. This reduces flickering a lot. | 1807 | the emacs screen when changing menubar. This reduces flickering. */ |
| 1776 | */ | ||
| 1777 | 1808 | ||
| 1778 | ac = 0; | 1809 | ac = 0; |
| 1779 | XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; | 1810 | XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |