diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index df96a260ed..8ab09ebea7 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -337,6 +337,8 @@ - (BOOL)trackManualMove { + GdkWindow *window = [[self contentView] gdkWindow]; + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); NSPoint currentLocation; NSPoint newOrigin; NSRect screenFrame = [[NSScreen mainScreen] visibleFrame]; @@ -350,8 +352,8 @@ newOrigin.y = currentLocation.y - initialMoveLocation.y; /* Clamp vertical position to below the menu bar. */ - if (newOrigin.y + windowFrame.size.height > screenFrame.origin.y + screenFrame.size.height) - newOrigin.y = screenFrame.origin.y + screenFrame.size.height - windowFrame.size.height; + if (newOrigin.y + windowFrame.size.height - impl->shadow_top > screenFrame.origin.y + screenFrame.size.height) + newOrigin.y = screenFrame.origin.y + screenFrame.size.height - windowFrame.size.height + impl->shadow_top; [self setFrameOrigin:newOrigin]; diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index 05b3b77beb..27ef1a5db3 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -2887,6 +2887,25 @@ gdk_quartz_window_set_opacity (GdkWindow *window, [impl->toplevel setAlphaValue: opacity]; } +static void +gdk_quartz_window_set_shadow_width (GdkWindow *window, + gint left, + gint right, + gint top, + gint bottom) +{ + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + + g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (WINDOW_IS_TOPLEVEL (window)); + + if (GDK_WINDOW_DESTROYED (window) || + !WINDOW_IS_TOPLEVEL (window)) + return; + + impl->shadow_top = top; +} + static cairo_region_t * gdk_quartz_window_get_shape (GdkWindow *window) { @@ -3000,6 +3019,7 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass) impl_class->begin_resize_drag = gdk_quartz_window_begin_resize_drag; impl_class->begin_move_drag = gdk_quartz_window_begin_move_drag; impl_class->set_opacity = gdk_quartz_window_set_opacity; + impl_class->set_shadow_width = gdk_quartz_window_set_shadow_width; impl_class->destroy_notify = gdk_quartz_window_destroy_notify; impl_class->register_dnd = _gdk_quartz_window_register_dnd; impl_class->drag_begin = _gdk_quartz_window_drag_begin; diff --git a/gdk/quartz/gdkwindow-quartz.h b/gdk/quartz/gdkwindow-quartz.h index dcd75b08d0..396035d331 100644 --- a/gdk/quartz/gdkwindow-quartz.h +++ b/gdk/quartz/gdkwindow-quartz.h @@ -62,6 +62,8 @@ struct _GdkWindowImplQuartz cairo_region_t *needs_display_region; cairo_surface_t *cairo_surface; + + gint shadow_top; }; struct _GdkWindowImplQuartzClass