Improve the tracking rect updating: - No need to override setFrame. - Use
2007-06-30 Richard Hult <richard@imendio.com> * 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. svn path=/trunk/; revision=18309
This commit is contained in:

committed by
Richard Hult

parent
a3b1739796
commit
8fd51a225e
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2007-06-30 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
|
* 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 <mclasen@redhat.com>
|
2007-06-30 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkbuilderparser.c (_gtk_builder_parse_boolean):
|
* gtk/gtkbuilderparser.c (_gtk_builder_parse_boolean):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* GdkQuartzView.m
|
/* GdkQuartzView.m
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005 Imendio AB
|
* Copyright (C) 2005-2007 Imendio AB
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -117,6 +117,7 @@
|
|||||||
{
|
{
|
||||||
GdkWindowObject *private = GDK_WINDOW_OBJECT (gdk_window);
|
GdkWindowObject *private = GDK_WINDOW_OBJECT (gdk_window);
|
||||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||||
|
NSRect rect;
|
||||||
|
|
||||||
if (trackingRect)
|
if (trackingRect)
|
||||||
{
|
{
|
||||||
@ -127,7 +128,12 @@
|
|||||||
if (!impl->toplevel)
|
if (!impl->toplevel)
|
||||||
return;
|
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
|
owner:self
|
||||||
userData:nil
|
userData:nil
|
||||||
assumeInside:NO];
|
assumeInside:NO];
|
||||||
@ -143,19 +149,13 @@
|
|||||||
|
|
||||||
-(void)viewWillMoveToWindow:(NSWindow *)newWindow
|
-(void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||||
{
|
{
|
||||||
if ([self window] && trackingRect)
|
if (newWindow == nil && trackingRect)
|
||||||
{
|
{
|
||||||
[self removeTrackingRect:trackingRect];
|
[self removeTrackingRect:trackingRect];
|
||||||
trackingRect = nil;
|
trackingRect = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)setFrame:(NSRect)frame
|
|
||||||
{
|
|
||||||
[super setFrame:frame];
|
|
||||||
[self updateTrackingRect];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void)setBounds:(NSRect)bounds
|
-(void)setBounds:(NSRect)bounds
|
||||||
{
|
{
|
||||||
[super setBounds:bounds];
|
[super setBounds:bounds];
|
||||||
|
@ -135,6 +135,8 @@
|
|||||||
impl->width = content_rect.size.width;
|
impl->width = content_rect.size.width;
|
||||||
impl->height = content_rect.size.height;
|
impl->height = content_rect.size.height;
|
||||||
|
|
||||||
|
[[self contentView] setBounds:NSMakeRect (0, 0, impl->width, impl->height)];
|
||||||
|
|
||||||
/* Synthesize a configure event */
|
/* Synthesize a configure event */
|
||||||
event = gdk_event_new (GDK_CONFIGURE);
|
event = gdk_event_new (GDK_CONFIGURE);
|
||||||
event->configure.window = g_object_ref (window);
|
event->configure.window = g_object_ref (window);
|
||||||
|
Reference in New Issue
Block a user