summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2015-07-20 08:32:05 +0200
committerChristoph Reiter <creiter@src.gnome.org>2015-07-23 13:18:49 +0200
commit61ce90a8e25ea63248ffa12707148e449494f34b (patch)
tree040f0e75a1fa9a8396e0d216cb4bf917137eb79e
parent707459fe4ea284386f31cd8e90ed4551d34c142a (diff)
downloadgtk+-61ce90a8e25ea63248ffa12707148e449494f34b.tar.gz
quartz: make moving CSD windows right up to the screen's menu bar work.
The default implementation prevents the window + shadow to move above the menu bar. Change it so only the window is considered.
-rw-r--r--gdk/quartz/GdkQuartzNSWindow.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
index 43348ef0f7..8795d3d762 100644
--- a/gdk/quartz/GdkQuartzNSWindow.c
+++ b/gdk/quartz/GdkQuartzNSWindow.c
@@ -673,4 +673,20 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
#endif
+- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
+{
+ NSRect rect;
+ GdkWindow *window = [[self contentView] gdkWindow];
+ GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
+
+ /* Allow the window to move up "shadow_top" more than normally allowed
+ * by the default impl. This makes it possible to move windows with
+ * client side shadow right up to the screen's menu bar. */
+ rect = [super constrainFrameRect:frameRect toScreen:screen];
+ if (frameRect.origin.y > rect.origin.y)
+ rect.origin.y = MIN (frameRect.origin.y, rect.origin.y + impl->shadow_top);
+
+ return rect;
+}
+
@end