From e7c3a905637a157d4989682c49b7c5691071eb81 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 8 Feb 2011 10:43:10 +0100 Subject: Force the repaint during live resize. During live resize on Mac, it is important to keep up with the resizing of the window, or the application looks sluggish. Calling update() is not enough, since we then are lagging behind the system by going through the event loop. Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qcocoawindowdelegate_mac.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index 6ce7b35..55f2db6 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -215,6 +215,11 @@ static void cleanupCocoaWindowDelegate() QWidgetPrivate::qt_mac_update_sizer(qwidget); [self syncSizeForWidget:qwidget toSize:newSize fromSize:oldSize]; } + + // We force the repaint to be synchronized with the resize of the window. + // Otherwise, the resize looks sluggish because we paint one event loop later. + if ([[window contentView] inLiveResize]) + qwidget->repaint(); } - (void)windowDidMove:(NSNotification *)notification -- cgit v0.12