Mercurial > emacs
diff src/xfns.c @ 109445:051595eb9b58
Merge changes from emacs-23 branch.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 16 Jul 2010 11:42:15 -0400 |
parents | 88a5b905a895 60266cf487b0 |
children | 05e7e7c46ff0 |
line wrap: on
line diff
--- a/src/xfns.c Fri Jul 16 14:09:55 2010 +0200 +++ b/src/xfns.c Fri Jul 16 11:42:15 2010 -0400 @@ -398,8 +398,9 @@ /* Likewise, but consider only the menu bar widget. */ struct frame * -x_menubar_window_to_frame (struct x_display_info *dpyinfo, int wdesc) +x_menubar_window_to_frame (struct x_display_info *dpyinfo, XEvent *event) { + Window wdesc = event->xany.window; Lisp_Object tail, frame; struct frame *f; struct x_output *x; @@ -415,21 +416,11 @@ if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) continue; x = f->output_data.x; +#ifdef USE_GTK + if (x->menubar_widget && xg_event_is_for_menubar (f, event)) + return f; +#else /* Match if the window is this frame's menubar. */ -#ifdef USE_GTK - if (x->menubar_widget) - { - GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc); - - /* This gives false positives, but the rectangle check in xterm.c - where this is called takes care of that. */ - if (gwdesc != 0 - && (gwdesc == x->menubar_widget - || gtk_widget_is_ancestor (x->menubar_widget, gwdesc) - || gtk_widget_is_ancestor (gwdesc, x->menubar_widget))) - return f; - } -#else if (x->menubar_widget && lw_window_is_in_menubar (wdesc, x->menubar_widget)) return f;