Bug 21300 - REGRESSION: Qt Mac scrollbars should avoid scroll corner resizers
Summary: REGRESSION: Qt Mac scrollbars should avoid scroll corner resizers
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: QtWebKit Unassigned
URL:
Keywords: Qt
Depends on:
Blocks: 35784
  Show dependency treegraph
 
Reported: 2008-10-02 00:22 PDT by Dave Hyatt
Modified: 2010-04-09 12:23 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2008-10-02 00:22:32 PDT
When making ScrollView cross-platform I removed the following code from updateScrollbars in ScrollViewQt:

#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
    // On Mac, offset the scrollbars so they don't cover the grow box. Check if the window 
    // has a grow box, and then check if the bottom-right corner of the scroll view 
    // intersercts it. The calculations are done in global coordinates.
    QWidget* contentWidget = containingWindow();
    if (contentWidget) {
        QWidget* windowWidget = contentWidget->window();
        if (windowWidget) {
            HIViewRef growBox = 0;
            HIViewFindByID(HIViewGetRoot(HIViewGetWindow(HIViewRef(contentWidget->winId()))), kHIViewWindowGrowBoxID, &growBox);
            const QPoint contentBr = contentWidget->mapToGlobal(QPoint(0,0)) + contentWidget->size();
            const QPoint windowBr = windowWidget->mapToGlobal(QPoint(0,0)) + windowWidget->size();
            const QPoint contentOffset = (windowBr - contentBr);
            const int growBoxSize = 15;
            const bool enableOffset = (growBox != 0 && contentOffset.x() >= 0 && contentOffset. y() >= 0);
            scrollbarOffset = enableOffset ? QPoint(growBoxSize - qMin(contentOffset.x(), growBoxSize),
                                                    growBoxSize - qMin(contentOffset.y(), growBoxSize))
                                           : QPoint(0,0);
        }
    }
#endif

This could was misplaced.  There is an actual API called windowResizerRect on the chrome client that can be used to return the rect of the resizer box (in Cocoa obtainable via [NSWIndow _growBoxRect].  Qt Mac should be implementing this API rather than injecting code into the ScrollView.  

In order for updateScrollers to be cross-platform, I removed this code.
Comment 1 Dave Hyatt 2008-10-03 12:05:37 PDT
"This could was misplaced. "

I meant to say "This code  was misplaced." :)

Comment 2 Tor Arne Vestbø 2010-03-25 10:11:38 PDT
Fix landed in r56552
Comment 3 Simon Hausmann 2010-03-26 07:12:43 PDT
Revision r56552 cherry-picked into qtwebkit-2.0 with commit e506553e355d1d2a2144d316914b0e44450e4405
Comment 4 Kenneth Rohde Christiansen 2010-04-09 12:13:10 PDT
(In reply to comment #2)
> Fix landed in r56552

This fix seems to have caused https://bugs.webkit.org/show_bug.cgi?id=36853