Daniel Novotny b42c14
--- emacs-23.1/configure.in.orig	2009-08-31 00:18:44.000000000 +0100
Daniel Novotny b42c14
+++ emacs-23.1/configure.in	2009-08-31 00:18:47.000000000 +0100
Daniel Novotny b42c14
@@ -1514,7 +1514,7 @@
Daniel Novotny b42c14
 HAVE_GTK=no
Daniel Novotny b42c14
 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
Daniel Novotny b42c14
   GLIB_REQUIRED=2.6
Daniel Novotny b42c14
-  GTK_REQUIRED=2.6
Daniel Novotny b42c14
+  GTK_REQUIRED=2.17.9
Daniel Novotny b42c14
   GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
Daniel Novotny b42c14
 
Daniel Novotny b42c14
   dnl Checks for libraries.
Daniel Novotny b42c14
--- emacs-23.1/src/xfns.c.orig	2009-08-31 00:03:02.000000000 +0100
Daniel Novotny b42c14
+++ emacs-23.1/src/xfns.c	2009-08-31 00:21:39.000000000 +0100
Daniel Novotny b42c14
@@ -468,8 +468,10 @@
Daniel Novotny b42c14
       if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
Daniel Novotny b42c14
 	continue;
Daniel Novotny b42c14
       x = f->output_data.x;
Daniel Novotny b42c14
-      /* Match if the window is this frame's menubar.  */
Daniel Novotny b42c14
 #ifdef USE_GTK
Daniel Novotny b42c14
+      /* Match if the window is this frame's window (button presses are no longer
Daniel Novotny b42c14
+         caught by the menubar) or a menu in the menubar.
Daniel Novotny b42c14
+       */
Daniel Novotny b42c14
       if (x->menubar_widget)
Daniel Novotny b42c14
         {
Daniel Novotny b42c14
           GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc);
Daniel Novotny b42c14
@@ -477,13 +479,14 @@
Daniel Novotny b42c14
 
Daniel Novotny b42c14
           BLOCK_INPUT;
Daniel Novotny b42c14
           if (gwdesc != 0
Daniel Novotny b42c14
-              && (gwdesc == x->menubar_widget
Daniel Novotny b42c14
+              && (gwdesc == gtk_widget_get_parent (gtk_widget_get_parent (x->menubar_widget))
Daniel Novotny b42c14
                   || gtk_widget_get_parent (gwdesc) == x->menubar_widget))
Daniel Novotny b42c14
             found = 1;
Daniel Novotny b42c14
           UNBLOCK_INPUT;
Daniel Novotny b42c14
           if (found) return f;
Daniel Novotny b42c14
         }
Daniel Novotny b42c14
 #else
Daniel Novotny b42c14
+      /* Match if the window is in this frame's menubar */
Daniel Novotny b42c14
       if (x->menubar_widget
Daniel Novotny b42c14
 	  && lw_window_is_in_menubar (wdesc, x->menubar_widget))
Daniel Novotny b42c14
 	return f;