diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 20 | ||||
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 9 | ||||
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 15 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 19 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_raster.cpp | 4 |
6 files changed, 9 insertions, 60 deletions
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 7829a4e..1a265d0 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -51,9 +51,6 @@ NSPanel, while QCocoaWindow needs to inherit NSWindow rather than NSPanel). ****************************************************************************/ -#include <private/qapplication_p.h> -#include <private/qbackingstore_p.h> - QT_BEGIN_NAMESPACE extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.mm extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp @@ -188,20 +185,3 @@ QT_END_NAMESPACE return [super frameViewClassForStyleMask:styleMask]; } -- (void)displayIfNeeded -{ - - QWidget *qwidget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; - if (qwidget == 0) { - [super displayIfNeeded]; - return; - } - - if (QApplicationPrivate::graphicsSystem() != 0) { - if (QWidgetBackingStore *bs = qt_widget_private(qwidget)->maybeBackingStore()) - bs->sync(qwidget, qwidget->rect()); - } - [super displayIfNeeded]; -} - - diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 2c35be2..d255604 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -520,11 +520,10 @@ extern "C" { - (void)drawRect:(NSRect)aRect { if (QApplicationPrivate::graphicsSystem() != 0) { - if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore()) { - // Drawing is handled on the window level - // See qcocoasharedwindowmethods_mac_p. - return; - } + if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore()) + bs->markDirty(qwidget->rect(), qwidget); + qwidgetprivate->syncBackingStore(qwidget->rect()); + return; } CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; qwidgetprivate->hd = cg; diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 65c04e5..e06a810 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1162,7 +1162,7 @@ CGContextRef qt_mac_graphicsContextFor(QWidget *widget) CGrafPtr port = GetWindowPort(qt_mac_window_for(widget)); QDBeginCGContext(port, &context); #else - CGContextRef context = reinterpret_cast<CGContextRef>([[qt_mac_window_for(widget) graphicsContext] graphicsPort]); + CGContextRef context = (CGContextRef)[[NSGraphicsContext graphicsContextWithWindow:qt_mac_window_for(widget)] graphicsPort]; #endif return context; } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 78a25ac..ffad38b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1660,13 +1660,7 @@ void QWidgetPrivate::syncBackingStore() repaint_sys(dirty); dirty = QRegion(); } else if (QWidgetBackingStore *bs = maybeBackingStore()) { -#ifdef QT_MAC_USE_COCOA - Q_UNUSED(bs); - void qt_mac_set_needs_display(QWidget *, QRegion); - qt_mac_set_needs_display(q_func(), QRegion()); -#else bs->sync(); -#endif } } @@ -1674,15 +1668,8 @@ void QWidgetPrivate::syncBackingStore(const QRegion ®ion) { if (paintOnScreen()) repaint_sys(region); - else if (QWidgetBackingStore *bs = maybeBackingStore()) { -#ifdef QT_MAC_USE_COCOA - Q_UNUSED(bs); - void qt_mac_set_needs_display(QWidget *, QRegion); - qt_mac_set_needs_display(q_func(), region); -#else + else if (QWidgetBackingStore *bs = maybeBackingStore()) bs->sync(q_func(), region); -#endif - } } void QWidgetPrivate::setUpdatesEnabled_helper(bool enable) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index b5888b4..78c1562 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -565,25 +565,6 @@ inline static void qt_mac_set_window_group_to_popup(OSWindowRef window) } #endif -#ifdef QT_MAC_USE_COCOA -void qt_mac_set_needs_display(QWidget *widget, QRegion region) -{ - NSView *theNSView = qt_mac_nativeview_for(widget); - if (region.isNull()) { - [theNSView setNeedsDisplay:YES]; - return; - } - - QVector<QRect> rects = region.rects(); - for (int i = 0; i<rects.count(); ++i) { - const QRect &rect = rects.at(i); - NSRect nsrect = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()); - [theNSView setNeedsDisplayInRect:nsrect]; - } - -} -#endif - inline static bool updateRedirectedToGraphicsProxyWidget(QWidget *widget, const QRect &rect) { if (!widget) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index eee6bef..a0d2b9b 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -295,8 +295,10 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi CGContextRestoreGState(context); #ifndef QT_MAC_USE_COCOA QDEndCGContext(port, &context); +#else + CGContextFlush(context); +#endif #endif -#endif // Q_WS_MAC #ifdef Q_OS_SYMBIAN Q_UNUSED(widget); |