summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-10-22 12:53:17 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-10-22 12:59:09 (GMT)
commitb63fc1726fe3df49c6577d8ac26095d0c8738925 (patch)
tree8af9833387102f2bc9962f7129ef7c6d38aa4c6b /src/gui/kernel
parent62cf25df02d2cce8957c5942b467dbbf050a763d (diff)
downloadQt-b63fc1726fe3df49c6577d8ac26095d0c8738925.zip
Qt-b63fc1726fe3df49c6577d8ac26095d0c8738925.tar.gz
Qt-b63fc1726fe3df49c6577d8ac26095d0c8738925.tar.bz2
Honor graphics system on Mac/Cocoa when exposing and resizing window
When exposing or resizing a previously hidden window on Cocoa, we would go through the CoreGraphicsPaintEngine even when a different graphics system was set. This was because there were two different paths from the windowing system into our paint event. The one going through the virtual drawRect function in QCocoaView did not honor the graphics system. This patch makes sure the backing store is used for these types of events as well. Done with: Gunnar Reviewed-by: MortenS
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 4c2a14a..417d54c 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -51,6 +51,7 @@
#include <private/qmacinputcontext_p.h>
#include <private/qmultitouch_mac_p.h>
#include <private/qevent_p.h>
+#include <private/qbackingstore_p.h>
#include <qscrollarea.h>
#include <qhash.h>
@@ -503,6 +504,13 @@ extern "C" {
- (void)drawRect:(NSRect)aRect
{
+ qDebug("drawRect");
+ if (QApplicationPrivate::graphicsSystem() != 0) {
+ if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore())
+ bs->markDirty(qwidget->rect(), qwidget);
+ qwidgetprivate->syncBackingStore(qwidget->rect());
+ return;
+ }
CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
qwidgetprivate->hd = cg;
CGContextSaveGState(cg);