diff --git a/ChangeLog b/ChangeLog index 33c4f100b7..2ca0272f8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-06-30 Richard Hult + + * gdk/quartz/GdkQuartzView.c: Improve the tracking rect updating: + - No need to override setFrame. + - Use our own size instead of the bounds from for the view as it's + not always updated before the tracking rect. + - Only reset the tracking rect if the new window is nil). + + * gdk/quartz/GdkQuartzWindow.c: Update the bounds of the content + view when the window size changes. + 2007-06-30 Matthias Clasen * gtk/gtkbuilderparser.c (_gtk_builder_parse_boolean): diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index fbeaf136f3..cb92928e7b 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -1,6 +1,6 @@ /* GdkQuartzView.m * - * Copyright (C) 2005 Imendio AB + * Copyright (C) 2005-2007 Imendio AB * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -117,6 +117,7 @@ { GdkWindowObject *private = GDK_WINDOW_OBJECT (gdk_window); GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl); + NSRect rect; if (trackingRect) { @@ -127,7 +128,12 @@ if (!impl->toplevel) return; - trackingRect = [self addTrackingRect:[self bounds] + /* Note, if we want to set assumeInside we can use: + * NSPointInRect ([[self window] convertScreenToBase:[NSEvent mouseLocation]], rect) + */ + + rect = NSMakeRect (0, 0, impl->width, impl->height); + trackingRect = [self addTrackingRect:rect owner:self userData:nil assumeInside:NO]; @@ -143,19 +149,13 @@ -(void)viewWillMoveToWindow:(NSWindow *)newWindow { - if ([self window] && trackingRect) + if (newWindow == nil && trackingRect) { [self removeTrackingRect:trackingRect]; trackingRect = nil; } } --(void)setFrame:(NSRect)frame -{ - [super setFrame:frame]; - [self updateTrackingRect]; -} - -(void)setBounds:(NSRect)bounds { [super setBounds:bounds]; diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c index 97c01e79e8..d86c21ddd2 100644 --- a/gdk/quartz/GdkQuartzWindow.c +++ b/gdk/quartz/GdkQuartzWindow.c @@ -135,6 +135,8 @@ impl->width = content_rect.size.width; impl->height = content_rect.size.height; + [[self contentView] setBounds:NSMakeRect (0, 0, impl->width, impl->height)]; + /* Synthesize a configure event */ event = gdk_event_new (GDK_CONFIGURE); event->configure.window = g_object_ref (window);