134 screenCount = [displays count]; |
134 screenCount = [displays count]; |
135 |
135 |
136 screenRects.clear(); |
136 screenRects.clear(); |
137 availableRects.clear(); |
137 availableRects.clear(); |
138 NSRect primaryRect = [[displays objectAtIndex:0] frame]; |
138 NSRect primaryRect = [[displays objectAtIndex:0] frame]; |
139 for (int i = 0; i<screenCount; i++) { |
139 for (int i = 0; i<screenCount; i++) { |
140 NSRect r = [[displays objectAtIndex:i] frame]; |
140 NSRect r = [[displays objectAtIndex:i] frame]; |
141 const int flippedY = - r.origin.y + // account for position offset and |
141 int flippedY = - r.origin.y + // account for position offset and |
142 primaryRect.size.height - r.size.height; // height difference. |
142 primaryRect.size.height - r.size.height; // height difference. |
143 screenRects.append(QRectF(r.origin.x, flippedY, |
143 screenRects.append(QRectF(r.origin.x, flippedY, |
144 r.size.width, r.size.height)); |
144 r.size.width, r.size.height)); |
145 r = [[displays objectAtIndex:i] visibleFrame]; |
145 |
|
146 r = [[displays objectAtIndex:i] visibleFrame]; |
|
147 flippedY = - r.origin.y + // account for position offset and |
|
148 primaryRect.size.height - r.size.height; // height difference. |
146 availableRects.append(QRectF(r.origin.x, flippedY, |
149 availableRects.append(QRectF(r.origin.x, flippedY, |
147 r.size.width, r.size.height)); |
150 r.size.width, r.size.height)); |
148 } |
151 } |
149 } |
152 } |
150 |
153 |
151 |
154 |
152 |
155 |
153 QDesktopWidget::QDesktopWidget() |
156 QDesktopWidget::QDesktopWidget() |