Commit f14bf846 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Fix performance regression for borderless transparent windows with shadow.

2008-02-27  Richard Hult  <richard@imendio.com>

	* gdk/quartz/GdkQuartzView.c:
	* gdk/quartz/GdkQuartzView.h:
	* gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_decorations):
	Fix performance regression for borderless transparent windows
	with shadow.

svn path=/trunk/; revision=19666
parent 2e73e9b4
2008-02-27 Richard Hult <richard@imendio.com>
* gdk/quartz/GdkQuartzView.c:
* gdk/quartz/GdkQuartzView.h:
* gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_decorations):
Fix performance regression for borderless transparent windows
with shadow.
2008-02-27 Emmanuele Bassi <ebassi@gnome.org>
* tests/testgtk.c: Revert back to r19454.
......
......@@ -116,15 +116,20 @@
gdk_region_destroy (region);
/* Invalidate the window shadow for non-opaque views that have shadow
* enabled, otherwise the shadow doesn't get updated to what we draw.
*/
if (![self isOpaque] && [[self window] hasShadow])
[[self window] invalidateShadow];
if (needsInvalidateShadow)
{
[[self window] invalidateShadow];
needsInvalidateShadow = NO;
}
GDK_QUARTZ_RELEASE_POOL;
}
-(void)setNeedsInvalidateShadow:(BOOL)invalidate
{
needsInvalidateShadow = invalidate;
}
/* For information on setting up tracking rects properly, see here:
* http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventOverview.pdf
*/
......
......@@ -24,9 +24,11 @@
@interface GdkQuartzView : NSView {
GdkWindow *gdk_window;
NSTrackingRectTag trackingRect;
BOOL needsInvalidateShadow;
}
-(void)setGdkWindow:(GdkWindow *)window;
-(GdkWindow *)gdkWindow;
-(void)setNeedsInvalidateShadow:(BOOL)invalidate;
@end
......@@ -2631,6 +2631,12 @@ gdk_window_set_decorations (GdkWindow *window,
[impl->toplevel setContentView:old_view];
[impl->toplevel setFrame:rect display:YES];
/* Invalidate the window shadow for non-opaque views that have shadow
* enabled, to get the shadow shape updated.
*/
if (![old_view isOpaque] && [impl->toplevel hasShadow])
[(GdkQuartzView*)old_view setNeedsInvalidateShadow:YES];
}
GDK_QUARTZ_RELEASE_POOL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment