diff options
author | Fred Emmott <mail@fredemmott.co.uk> | 2009-11-06 10:27:57 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-06 10:27:57 (GMT) |
commit | d895d7cc8908ce5c6157c8261b9145d81b21501f (patch) | |
tree | 9db5bc3a4ed75eb7c7231480728a7b9687ada80c /src | |
parent | 0b0b31577898305fcc351e98f3ce2bb392869eb3 (diff) | |
download | Qt-d895d7cc8908ce5c6157c8261b9145d81b21501f.zip Qt-d895d7cc8908ce5c6157c8261b9145d81b21501f.tar.gz Qt-d895d7cc8908ce5c6157c8261b9145d81b21501f.tar.bz2 |
Fix QDesktopWidget::availableGeometry() on OSX
Was ignoring top OSX menu bar.
Example c++: http://pastebin.ca/1585763 http://fred.uwcs.co.uk/testAvailableGeometry.cpp
Example output: http://pastebin.ca/1585766 http://fred.uwcs.co.uk/testAvailableGeometry.output
Introduced by commit 13254da6c3192937812983f44ce95fe8e1bc602c
Merge-request: 1652
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qdesktopwidget_mac.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qdesktopwidget_mac.mm b/src/gui/kernel/qdesktopwidget_mac.mm index 88dc173..1020435 100644 --- a/src/gui/kernel/qdesktopwidget_mac.mm +++ b/src/gui/kernel/qdesktopwidget_mac.mm @@ -136,16 +136,20 @@ void QDesktopWidgetImplementation::onResize() screenRects.clear(); availableRects.clear(); NSRect primaryRect = [[displays objectAtIndex:0] frame]; - for (int i = 0; i<screenCount; i++) { - NSRect r = [[displays objectAtIndex:i] frame]; + for (int i = 0; i<screenCount; i++) { + const NSRect r = [[displays objectAtIndex:i] frame]; const int flippedY = - r.origin.y + // account for position offset and primaryRect.size.height - r.size.height; // height difference. screenRects.append(QRectF(r.origin.x, flippedY, r.size.width, r.size.height)); - r = [[displays objectAtIndex:i] visibleFrame]; + } + for (int i = 0; i<screenCount; i++) { + const NSRect r = [[displays objectAtIndex:i] visibleFrame]; + const int flippedY = - r.origin.y + // account for position offset and + primaryRect.size.height - r.size.height; // height difference. availableRects.append(QRectF(r.origin.x, flippedY, r.size.width, r.size.height)); - } + } } |