 -
 -                    if (sv == toplevel_impl->layer_view)
 -                      continue;
-+                  subview = find_nsview_at_pos (toplevel_impl->view, *x, *y);
-+                  if (subview != NULL && ![subview isKindOfClass:[GdkQuartzView class]]) {
-+                    g_signal_emit_by_name (toplevel, "native-child-event",
-+                                           subview, nsevent);
- 
+-
 -                    if (r.origin.x <= *x && r.origin.x + r.size.width >= *x &&
 -                        r.origin.y <= *y && r.origin.y + r.size.height >= *y)
 -                      {
 -                        g_signal_emit_by_name (toplevel, "native-child-event",
 -                                               sv, nsevent);
--
++                subview = find_nsview_at_pos (toplevel_impl, *x, *y);
++                if (subview != NULL && ![subview isKindOfClass:[GdkQuartzView class]]) {
++                  g_signal_emit_by_name (toplevel, "native-child-event",
++                                         subview, nsevent);
+ 
 -                        /* event is within subview, forward back to Cocoa */
 -                        return NULL;
 -                      }
-+                    /* event is within subview, forward back to Cocoa */
-+                    return NULL;
-                   }
+-                  }
++                  /* event is within subview, forward back to Cocoa */
++                  return NULL;
++                }
  
                  *x = x_tmp;
-@@ -1665,6 +1679,11 @@ gdk_event_translate (GdkEvent *event,
+                 *y = y_tmp;
+@@ -1665,6 +1683,11 @@ gdk_event_translate (GdkEvent *event,
        GdkWindowObject *private = (GdkWindowObject *)window;
        GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
  

 static GdkWindow *
 find_toplevel_under_pointer (GdkDisplay *display,
                              NSPoint     screen_point,
@@ -869,33 +896,20 @@ find_window_for_ns_event (NSEvent *nsevent,
               {
                 GdkWindowObject *toplevel_private;
                 GdkWindowImplQuartz *toplevel_impl;

@@ -722,6 +722,9 @@ void       gdk_window_redirect_to_drawable   (GdkWindow     *window,
                                               gint           height);
 void       gdk_window_remove_redirection     (GdkWindow     *window);
 
+/* NSView embedding */
+gboolean   gdk_window_supports_nsview_embedding ();
+
 #ifndef GDK_DISABLE_DEPRECATED
 #ifndef GDK_MULTIHEAD_SAFE
 GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);   
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index 1c92714..3c7ba37 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -122,6 +122,11 @@
