From f8d5f2594a9b268b9eeecf95b24b23fc940c71ce Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Wed, 17 Mar 2010 12:09:03 +0100 Subject: Cocoa: minisplitter has only 1px wide grab area The problem was that in Cocoa we were ignoring the WA_MouseNoMask attribute, therefore the mask was being applied to the mouse movements. This in turn caused the cursor not to change accordingly. Task-number: QTCREATORBUG-361 Reviewed-by: Prasanth --- src/gui/kernel/qcocoaview_mac.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 4f71681..a627616 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -241,7 +241,8 @@ static int qCocoaViewCount = 0; QRegion mask = qt_widget_private(cursorWidget)->extra->mask; NSCursor *nscursor = static_cast(qt_mac_nsCursorForQCursor(cursorWidget->cursor())); - if (mask.isEmpty()) { + // The mask could have the WA_MouseNoMask attribute set and that means that we have to ignore the mask. + if (mask.isEmpty() || cursorWidget->testAttribute(Qt::WA_MouseNoMask)) { [self addCursorRect:[qt_mac_nativeview_for(cursorWidget) visibleRect] cursor:nscursor]; } else { const QVector &rects = mask.rects(); @@ -490,7 +491,9 @@ static int qCocoaViewCount = 0; CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; qwidgetprivate->hd = cg; CGContextSaveGState(cg); - + CGFloat components[] = {1,0,0,1}; + CGContextSetFillColor(cg, components); + CGContextFillRect(cg, aRect); if (qwidget->isVisible() && qwidget->updatesEnabled()) { //process the actual paint event. if (qwidget->testAttribute(Qt::WA_WState_InPaintEvent)) qWarning("QWidget::repaint: Recursive repaint detected"); -- cgit v0.12