Merge lp:~dandrader/qtubuntu/improve-resize into lp:qtubuntu
- improve-resize
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~dandrader/qtubuntu/improve-resize |
Merge into: | lp:qtubuntu |
Diff against target: |
324 lines (+58/-84) 4 files modified
debian/control (+1/-1) src/ubuntumirclient/input.cpp (+28/-27) src/ubuntumirclient/window.cpp (+29/-52) src/ubuntumirclient/window.h (+0/-4) |
To merge this branch: | bzr merge lp:~dandrader/qtubuntu/improve-resize |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gerry Boland (community) | Needs Fixing | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+258912@code.launchpad.net |
This proposal has been superseded by a proposal from 2015-06-03.
Commit message
Drastically improve surface resize responsiveness
QWindowSystemIn
There was also some miscommunication between the now absent handleBufferRes
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
Gerry Boland (gerboland) wrote : | # |
=== modified file 'src/ubuntumirc
+/*
+*/
necessary change?
In testing with mir_proving_server, I notice one problem: the surface size QML requests is not the size it gets. Think the geometry.setY() call is problematic now. This used to work before.
Remainder looks good. Am worried that there are 3+ threads (Qt GUI, Qt renderers, Mir input) all interacting with this class tho.
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 09:12, Gerry Boland wrote:
> === modified file 'src/ubuntumirc
> +/*
> +*/
> necessary change?
Yes, code won't build otherwise in a debug config. I've the same change
in another top-approved-
Daniel d'Andrada (dandrader) wrote : | # |
> In testing with mir_proving_server, I notice one problem: the surface size QML
> requests is not the size it gets.
This also happens with lp:qtubuntu.
I request (w=600,h=600) and get a geometry of (x=0,y=
- 260. By Daniel d'Andrada
- 261. By Daniel d'Andrada
-
Refactor optional logging and remove trailing whitespace
Unmerged revisions
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2015-03-05 19:54:57 +0000 | |||
3 | +++ debian/control 2015-06-03 13:24:47 +0000 | |||
4 | @@ -17,7 +17,7 @@ | |||
5 | 17 | qtbase5-private-dev, | 17 | qtbase5-private-dev, |
6 | 18 | qtdeclarative5-dev, | 18 | qtdeclarative5-dev, |
7 | 19 | libqt5sensors5-dev, | 19 | libqt5sensors5-dev, |
9 | 20 | libmirclient-dev (>= 0.11.0), | 20 | libmirclient-dev (>= 0.13.0), |
10 | 21 | # if you don't have have commit access to this branch but would like to upload | 21 | # if you don't have have commit access to this branch but would like to upload |
11 | 22 | # directly to Ubuntu, don't worry: your changes will be merged back into the | 22 | # directly to Ubuntu, don't worry: your changes will be merged back into the |
12 | 23 | # upstream branch | 23 | # upstream branch |
13 | 24 | 24 | ||
14 | === modified file 'src/ubuntumirclient/input.cpp' | |||
15 | --- src/ubuntumirclient/input.cpp 2015-02-17 17:39:47 +0000 | |||
16 | +++ src/ubuntumirclient/input.cpp 2015-06-03 13:24:47 +0000 | |||
17 | @@ -160,6 +160,7 @@ | |||
18 | 160 | #ifndef QT_NO_DEBUG | 160 | #ifndef QT_NO_DEBUG |
19 | 161 | 161 | ||
20 | 162 | 162 | ||
21 | 163 | /* | ||
22 | 163 | static const char* nativeEventTypeToStr(MirEventType t) | 164 | static const char* nativeEventTypeToStr(MirEventType t) |
23 | 164 | { | 165 | { |
24 | 165 | switch (t) | 166 | switch (t) |
25 | @@ -185,7 +186,7 @@ | |||
26 | 185 | return "invalid"; | 186 | return "invalid"; |
27 | 186 | } | 187 | } |
28 | 187 | } | 188 | } |
30 | 188 | 189 | */ | |
31 | 189 | 190 | ||
32 | 190 | #endif | 191 | #endif |
33 | 191 | 192 | ||
34 | @@ -275,7 +276,7 @@ | |||
35 | 275 | 276 | ||
36 | 276 | void UbuntuInput::dispatchTouchEvent(QWindow *window, const MirInputEvent *ev) | 277 | void UbuntuInput::dispatchTouchEvent(QWindow *window, const MirInputEvent *ev) |
37 | 277 | { | 278 | { |
39 | 278 | const MirTouchInputEvent *tev = mir_input_event_get_touch_input_event(ev); | 279 | const MirTouchEvent *tev = mir_input_event_get_touch_event(ev); |
40 | 279 | 280 | ||
41 | 280 | // FIXME(loicm) Max pressure is device specific. That one is for the Samsung Galaxy Nexus. That | 281 | // FIXME(loicm) Max pressure is device specific. That one is for the Samsung Galaxy Nexus. That |
42 | 281 | // needs to be fixed as soon as the compat input lib adds query support. | 282 | // needs to be fixed as soon as the compat input lib adds query support. |
43 | @@ -286,30 +287,30 @@ | |||
44 | 286 | 287 | ||
45 | 287 | // TODO: Is it worth setting the Qt::TouchPointStationary ones? Currently they are left | 288 | // TODO: Is it worth setting the Qt::TouchPointStationary ones? Currently they are left |
46 | 288 | // as Qt::TouchPointMoved | 289 | // as Qt::TouchPointMoved |
48 | 289 | const unsigned int kPointerCount = mir_touch_input_event_get_touch_count(tev); | 290 | const unsigned int kPointerCount = mir_touch_event_point_count(tev); |
49 | 290 | for (unsigned int i = 0; i < kPointerCount; ++i) { | 291 | for (unsigned int i = 0; i < kPointerCount; ++i) { |
50 | 291 | QWindowSystemInterface::TouchPoint touchPoint; | 292 | QWindowSystemInterface::TouchPoint touchPoint; |
51 | 292 | 293 | ||
58 | 293 | const float kX = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_x) + kWindowGeometry.x(); | 294 | const float kX = mir_touch_event_axis_value(tev, i, mir_touch_axis_x) + kWindowGeometry.x(); |
59 | 294 | const float kY = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_y) + kWindowGeometry.y(); // see bug lp:1346633 workaround comments elsewhere | 295 | const float kY = mir_touch_event_axis_value(tev, i, mir_touch_axis_y) + kWindowGeometry.y(); // see bug lp:1346633 workaround comments elsewhere |
60 | 295 | const float kW = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_touch_major); | 296 | const float kW = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_major); |
61 | 296 | const float kH = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_touch_minor); | 297 | const float kH = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_minor); |
62 | 297 | const float kP = mir_touch_input_event_get_touch_axis_value(tev, i, mir_touch_input_axis_pressure); | 298 | const float kP = mir_touch_event_axis_value(tev, i, mir_touch_axis_pressure); |
63 | 298 | touchPoint.id = mir_touch_input_event_get_touch_id(tev, i); | 299 | touchPoint.id = mir_touch_event_id(tev, i); |
64 | 299 | touchPoint.normalPosition = QPointF(kX / kWindowGeometry.width(), kY / kWindowGeometry.height()); | 300 | touchPoint.normalPosition = QPointF(kX / kWindowGeometry.width(), kY / kWindowGeometry.height()); |
65 | 300 | touchPoint.area = QRectF(kX - (kW / 2.0), kY - (kH / 2.0), kW, kH); | 301 | touchPoint.area = QRectF(kX - (kW / 2.0), kY - (kH / 2.0), kW, kH); |
66 | 301 | touchPoint.pressure = kP / kMaxPressure; | 302 | touchPoint.pressure = kP / kMaxPressure; |
67 | 302 | 303 | ||
69 | 303 | MirTouchInputEventTouchAction touch_action = mir_touch_input_event_get_touch_action(tev, i); | 304 | MirTouchAction touch_action = mir_touch_event_action(tev, i); |
70 | 304 | switch (touch_action) | 305 | switch (touch_action) |
71 | 305 | { | 306 | { |
73 | 306 | case mir_touch_input_event_action_down: | 307 | case mir_touch_action_down: |
74 | 307 | touchPoint.state = Qt::TouchPointPressed; | 308 | touchPoint.state = Qt::TouchPointPressed; |
75 | 308 | break; | 309 | break; |
77 | 309 | case mir_touch_input_event_action_up: | 310 | case mir_touch_action_up: |
78 | 310 | touchPoint.state = Qt::TouchPointReleased; | 311 | touchPoint.state = Qt::TouchPointReleased; |
79 | 311 | break; | 312 | break; |
81 | 312 | case mir_touch_input_event_action_change: | 313 | case mir_touch_action_change: |
82 | 313 | default: | 314 | default: |
83 | 314 | touchPoint.state = Qt::TouchPointMoved; | 315 | touchPoint.state = Qt::TouchPointMoved; |
84 | 315 | } | 316 | } |
85 | @@ -363,23 +364,23 @@ | |||
86 | 363 | 364 | ||
87 | 364 | void UbuntuInput::dispatchKeyEvent(QWindow *window, const MirInputEvent *event) | 365 | void UbuntuInput::dispatchKeyEvent(QWindow *window, const MirInputEvent *event) |
88 | 365 | { | 366 | { |
90 | 366 | const MirKeyInputEvent *key_event = mir_input_event_get_key_input_event(event); | 367 | const MirKeyboardEvent *key_event = mir_input_event_get_keyboard_event(event); |
91 | 367 | 368 | ||
92 | 368 | ulong timestamp = mir_input_event_get_event_time(event) / 1000000; | 369 | ulong timestamp = mir_input_event_get_event_time(event) / 1000000; |
94 | 369 | xkb_keysym_t xk_sym = mir_key_input_event_get_key_code(key_event); | 370 | xkb_keysym_t xk_sym = mir_keyboard_event_key_code(key_event); |
95 | 370 | 371 | ||
96 | 371 | // Key modifier and unicode index mapping. | 372 | // Key modifier and unicode index mapping. |
98 | 372 | auto modifiers = qt_modifiers_from_mir(mir_key_input_event_get_modifiers(key_event)); | 373 | auto modifiers = qt_modifiers_from_mir(mir_keyboard_event_modifiers(key_event)); |
99 | 373 | 374 | ||
102 | 374 | MirKeyInputEventAction action = mir_key_input_event_get_action(key_event); | 375 | MirKeyboardAction action = mir_keyboard_event_action(key_event); |
103 | 375 | QEvent::Type keyType = action == mir_key_input_event_action_up | 376 | QEvent::Type keyType = action == mir_keyboard_action_up |
104 | 376 | ? QEvent::KeyRelease : QEvent::KeyPress; | 377 | ? QEvent::KeyRelease : QEvent::KeyPress; |
105 | 377 | 378 | ||
106 | 378 | char s[2]; | 379 | char s[2]; |
107 | 379 | int sym = translateKeysym(xk_sym, s, sizeof(s)); | 380 | int sym = translateKeysym(xk_sym, s, sizeof(s)); |
108 | 380 | QString text = QString::fromLatin1(s); | 381 | QString text = QString::fromLatin1(s); |
109 | 381 | 382 | ||
111 | 382 | bool is_auto_rep = action == mir_key_input_event_action_repeat; | 383 | bool is_auto_rep = action == mir_keyboard_action_repeat; |
112 | 383 | 384 | ||
113 | 384 | QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext(); | 385 | QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext(); |
114 | 385 | if (context) { | 386 | if (context) { |
115 | @@ -396,14 +397,14 @@ | |||
116 | 396 | 397 | ||
117 | 397 | namespace | 398 | namespace |
118 | 398 | { | 399 | { |
120 | 399 | Qt::MouseButtons extract_buttons(const MirPointerInputEvent *pev) | 400 | Qt::MouseButtons extract_buttons(const MirPointerEvent *pev) |
121 | 400 | { | 401 | { |
122 | 401 | Qt::MouseButtons buttons = Qt::NoButton; | 402 | Qt::MouseButtons buttons = Qt::NoButton; |
124 | 402 | if (mir_pointer_input_event_get_button_state(pev, mir_pointer_input_button_primary)) | 403 | if (mir_pointer_event_button_state(pev, mir_pointer_button_primary)) |
125 | 403 | buttons |= Qt::LeftButton; | 404 | buttons |= Qt::LeftButton; |
127 | 404 | if (mir_pointer_input_event_get_button_state(pev, mir_pointer_input_button_secondary)) | 405 | if (mir_pointer_event_button_state(pev, mir_pointer_button_secondary)) |
128 | 405 | buttons |= Qt::RightButton; | 406 | buttons |= Qt::RightButton; |
130 | 406 | if (mir_pointer_input_event_get_button_state(pev, mir_pointer_input_button_tertiary)) | 407 | if (mir_pointer_event_button_state(pev, mir_pointer_button_tertiary)) |
131 | 407 | buttons |= Qt::MidButton; | 408 | buttons |= Qt::MidButton; |
132 | 408 | 409 | ||
133 | 409 | // TODO: Should mir back and forward buttons exist? | 410 | // TODO: Should mir back and forward buttons exist? |
134 | @@ -416,12 +417,12 @@ | |||
135 | 416 | { | 417 | { |
136 | 417 | auto timestamp = mir_input_event_get_event_time(ev) / 1000000; | 418 | auto timestamp = mir_input_event_get_event_time(ev) / 1000000; |
137 | 418 | 419 | ||
140 | 419 | auto pev = mir_input_event_get_pointer_input_event(ev); | 420 | auto pev = mir_input_event_get_pointer_event(ev); |
141 | 420 | auto modifiers = qt_modifiers_from_mir(mir_pointer_input_event_get_modifiers(pev)); | 421 | auto modifiers = qt_modifiers_from_mir(mir_pointer_event_modifiers(pev)); |
142 | 421 | auto buttons = extract_buttons(pev); | 422 | auto buttons = extract_buttons(pev); |
143 | 422 | 423 | ||
146 | 423 | auto local_point = QPointF(mir_pointer_input_event_get_axis_value(pev, mir_pointer_input_axis_x), | 424 | auto local_point = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_x), |
147 | 424 | mir_pointer_input_event_get_axis_value(pev, mir_pointer_input_axis_y)); | 425 | mir_pointer_event_axis_value(pev, mir_pointer_axis_y)); |
148 | 425 | 426 | ||
149 | 426 | QWindowSystemInterface::handleMouseEvent(window, timestamp, local_point, local_point /* Should we omit global point instead? */, | 427 | QWindowSystemInterface::handleMouseEvent(window, timestamp, local_point, local_point /* Should we omit global point instead? */, |
150 | 427 | buttons, modifiers); | 428 | buttons, modifiers); |
151 | 428 | 429 | ||
152 | === modified file 'src/ubuntumirclient/window.cpp' | |||
153 | --- src/ubuntumirclient/window.cpp 2015-02-23 19:53:45 +0000 | |||
154 | +++ src/ubuntumirclient/window.cpp 2015-06-03 13:24:47 +0000 | |||
155 | @@ -96,7 +96,6 @@ | |||
156 | 96 | WId id; | 96 | WId id; |
157 | 97 | UbuntuInput* input; | 97 | UbuntuInput* input; |
158 | 98 | Qt::WindowState state; | 98 | Qt::WindowState state; |
159 | 99 | QRect geometry; | ||
160 | 100 | MirConnection *connection; | 99 | MirConnection *connection; |
161 | 101 | MirSurface* surface; | 100 | MirSurface* surface; |
162 | 102 | QSize bufferSize; | 101 | QSize bufferSize; |
163 | @@ -119,8 +118,7 @@ | |||
164 | 119 | UbuntuWindow* platformWindow = static_cast<UbuntuWindow*>(context); | 118 | UbuntuWindow* platformWindow = static_cast<UbuntuWindow*>(context); |
165 | 120 | platformWindow->priv()->surface = surface; | 119 | platformWindow->priv()->surface = surface; |
166 | 121 | 120 | ||
169 | 122 | MirEventDelegate handler = {eventCallback, context}; | 121 | mir_surface_set_event_handler(surface, eventCallback, context); |
168 | 123 | mir_surface_set_event_handler(surface, &handler); | ||
170 | 124 | } | 122 | } |
171 | 125 | 123 | ||
172 | 126 | UbuntuWindow::UbuntuWindow(QWindow* w, QSharedPointer<UbuntuClipboard> clipboard, UbuntuScreen* screen, | 124 | UbuntuWindow::UbuntuWindow(QWindow* w, QSharedPointer<UbuntuClipboard> clipboard, UbuntuScreen* screen, |
173 | @@ -141,8 +139,8 @@ | |||
174 | 141 | d->id = id++; | 139 | d->id = id++; |
175 | 142 | 140 | ||
176 | 143 | // Use client geometry if set explicitly, use available screen geometry otherwise. | 141 | // Use client geometry if set explicitly, use available screen geometry otherwise. |
179 | 144 | d->geometry = window()->geometry() != screen->geometry() ? | 142 | QPlatformWindow::setGeometry(window()->geometry() != screen->geometry() ? |
180 | 145 | window()->geometry() : screen->availableGeometry(); | 143 | window()->geometry() : screen->availableGeometry()); |
181 | 146 | createWindow(); | 144 | createWindow(); |
182 | 147 | DLOG("UbuntuWindow::UbuntuWindow (this=%p, w=%p, screen=%p, input=%p)", this, w, screen, input); | 145 | DLOG("UbuntuWindow::UbuntuWindow (this=%p, w=%p, screen=%p, input=%p)", this, w, screen, input); |
183 | 148 | } | 146 | } |
184 | @@ -254,7 +252,7 @@ | |||
185 | 254 | geometry.setY(panelHeight); | 252 | geometry.setY(panelHeight); |
186 | 255 | } else { | 253 | } else { |
187 | 256 | printf("UbuntuWindow - regular geometry\n"); | 254 | printf("UbuntuWindow - regular geometry\n"); |
189 | 257 | geometry = d->geometry; | 255 | geometry = this->geometry(); |
190 | 258 | geometry.setY(panelHeight); | 256 | geometry.setY(panelHeight); |
191 | 259 | } | 257 | } |
192 | 260 | 258 | ||
193 | @@ -279,7 +277,7 @@ | |||
194 | 279 | mir_surface_spec_release(spec); | 277 | mir_surface_spec_release(spec); |
195 | 280 | 278 | ||
196 | 281 | DASSERT(d->surface != NULL); | 279 | DASSERT(d->surface != NULL); |
198 | 282 | d->createEGLSurface((EGLNativeWindowType)mir_surface_get_egl_native_window(d->surface)); | 280 | d->createEGLSurface((EGLNativeWindowType)mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(d->surface))); |
199 | 283 | 281 | ||
200 | 284 | if (d->state == Qt::WindowFullScreen) { | 282 | if (d->state == Qt::WindowFullScreen) { |
201 | 285 | // TODO: We could set this on creation once surface spec supports it (mps already up) | 283 | // TODO: We could set this on creation once surface spec supports it (mps already up) |
202 | @@ -315,22 +313,16 @@ | |||
203 | 315 | 313 | ||
204 | 316 | void UbuntuWindow::handleSurfaceResize(int width, int height) | 314 | void UbuntuWindow::handleSurfaceResize(int width, int height) |
205 | 317 | { | 315 | { |
206 | 316 | QMutexLocker(&d->mutex); | ||
207 | 318 | LOG("UbuntuWindow::handleSurfaceResize(width=%d, height=%d)", width, height); | 317 | LOG("UbuntuWindow::handleSurfaceResize(width=%d, height=%d)", width, height); |
208 | 319 | 318 | ||
209 | 320 | // The current buffer size hasn't actually changed. so just render on it and swap | 319 | // The current buffer size hasn't actually changed. so just render on it and swap |
210 | 321 | // buffers until we render on a buffer with the target size. | 320 | // buffers until we render on a buffer with the target size. |
211 | 322 | 321 | ||
223 | 323 | bool shouldSwapBuffers; | 322 | d->targetBufferSize.rwidth() = width; |
224 | 324 | 323 | d->targetBufferSize.rheight() = height; | |
225 | 325 | { | 324 | |
226 | 326 | QMutexLocker(&d->mutex); | 325 | if (d->bufferSize != d->targetBufferSize) { |
216 | 327 | d->targetBufferSize.rwidth() = width; | ||
217 | 328 | d->targetBufferSize.rheight() = height; | ||
218 | 329 | |||
219 | 330 | shouldSwapBuffers = d->bufferSize != d->targetBufferSize; | ||
220 | 331 | } | ||
221 | 332 | |||
222 | 333 | if (shouldSwapBuffers) { | ||
227 | 334 | QWindowSystemInterface::handleExposeEvent(window(), geometry()); | 326 | QWindowSystemInterface::handleExposeEvent(window(), geometry()); |
228 | 335 | } else { | 327 | } else { |
229 | 336 | qWarning("[ubuntumirclient QPA] UbuntuWindow::handleSurfaceResize" | 328 | qWarning("[ubuntumirclient QPA] UbuntuWindow::handleSurfaceResize" |
230 | @@ -357,35 +349,6 @@ | |||
231 | 357 | QWindowSystemInterface::handleWindowActivated(activatedWindow, Qt::ActiveWindowFocusReason); | 349 | QWindowSystemInterface::handleWindowActivated(activatedWindow, Qt::ActiveWindowFocusReason); |
232 | 358 | } | 350 | } |
233 | 359 | 351 | ||
234 | 360 | void UbuntuWindow::handleBufferResize(int width, int height) | ||
235 | 361 | { | ||
236 | 362 | DLOG("UbuntuWindow::handleBufferResize(width=%d, height=%d)", width, height); | ||
237 | 363 | |||
238 | 364 | QRect oldGeometry; | ||
239 | 365 | QRect newGeometry; | ||
240 | 366 | |||
241 | 367 | { | ||
242 | 368 | QMutexLocker(&d->mutex); | ||
243 | 369 | oldGeometry = geometry(); | ||
244 | 370 | newGeometry = oldGeometry; | ||
245 | 371 | newGeometry.setWidth(width); | ||
246 | 372 | newGeometry.setHeight(height); | ||
247 | 373 | |||
248 | 374 | d->bufferSize.rwidth() = width; | ||
249 | 375 | d->bufferSize.rheight() = height; | ||
250 | 376 | d->geometry = newGeometry; | ||
251 | 377 | } | ||
252 | 378 | |||
253 | 379 | QPlatformWindow::setGeometry(newGeometry); | ||
254 | 380 | QWindowSystemInterface::handleGeometryChange(window(), newGeometry, oldGeometry); | ||
255 | 381 | QWindowSystemInterface::handleExposeEvent(window(), newGeometry); | ||
256 | 382 | } | ||
257 | 383 | |||
258 | 384 | void UbuntuWindow::forceRedraw() | ||
259 | 385 | { | ||
260 | 386 | QWindowSystemInterface::handleExposeEvent(window(), geometry()); | ||
261 | 387 | } | ||
262 | 388 | |||
263 | 389 | void UbuntuWindow::setWindowState(Qt::WindowState state) | 352 | void UbuntuWindow::setWindowState(Qt::WindowState state) |
264 | 390 | { | 353 | { |
265 | 391 | QMutexLocker(&d->mutex); | 354 | QMutexLocker(&d->mutex); |
266 | @@ -407,7 +370,7 @@ | |||
267 | 407 | 370 | ||
268 | 408 | { | 371 | { |
269 | 409 | QMutexLocker(&d->mutex); | 372 | QMutexLocker(&d->mutex); |
271 | 410 | d->geometry = rect; | 373 | QPlatformWindow::setGeometry(rect); |
272 | 411 | doMoveResize = d->state != Qt::WindowFullScreen && d->state != Qt::WindowMaximized; | 374 | doMoveResize = d->state != Qt::WindowFullScreen && d->state != Qt::WindowMaximized; |
273 | 412 | } | 375 | } |
274 | 413 | 376 | ||
275 | @@ -451,16 +414,30 @@ | |||
276 | 451 | 414 | ||
277 | 452 | if (sizeKnown && (d->bufferSize.width() != newBufferWidth || | 415 | if (sizeKnown && (d->bufferSize.width() != newBufferWidth || |
278 | 453 | d->bufferSize.height() != newBufferHeight)) { | 416 | d->bufferSize.height() != newBufferHeight)) { |
282 | 454 | QMetaObject::invokeMethod(this, "handleBufferResize", | 417 | |
283 | 455 | Qt::QueuedConnection, | 418 | DLOG("UbuntuWindow::onBuffersSwapped_threadSafe - buffer size changed from (%d,%d) to (%d,%d)", |
284 | 456 | Q_ARG(int, newBufferWidth), Q_ARG(int, newBufferHeight)); | 419 | d->bufferSize.width(), d->bufferSize.height(), newBufferWidth, newBufferHeight); |
285 | 420 | |||
286 | 421 | d->bufferSize.rwidth() = newBufferWidth; | ||
287 | 422 | d->bufferSize.rheight() = newBufferHeight; | ||
288 | 423 | |||
289 | 424 | QRect newGeometry; | ||
290 | 425 | |||
291 | 426 | newGeometry = geometry(); | ||
292 | 427 | newGeometry.setWidth(d->bufferSize.width()); | ||
293 | 428 | newGeometry.setHeight(d->bufferSize.height()); | ||
294 | 429 | |||
295 | 430 | QPlatformWindow::setGeometry(newGeometry); | ||
296 | 431 | QWindowSystemInterface::handleGeometryChange(window(), newGeometry, QRect()); | ||
297 | 432 | QWindowSystemInterface::handleExposeEvent(window(), newGeometry); | ||
298 | 433 | |||
299 | 457 | } else { | 434 | } else { |
300 | 458 | // buffer size hasn't changed | 435 | // buffer size hasn't changed |
301 | 459 | if (d->targetBufferSize.isValid()) { | 436 | if (d->targetBufferSize.isValid()) { |
302 | 460 | if (d->bufferSize != d->targetBufferSize) { | 437 | if (d->bufferSize != d->targetBufferSize) { |
303 | 461 | // but we still didn't reach the promised buffer size from the mir resize event. | 438 | // but we still didn't reach the promised buffer size from the mir resize event. |
304 | 462 | // thus keep swapping buffers | 439 | // thus keep swapping buffers |
306 | 463 | QMetaObject::invokeMethod(this, "forceRedraw", Qt::QueuedConnection); | 440 | QWindowSystemInterface::handleExposeEvent(window(), geometry()); |
307 | 464 | } else { | 441 | } else { |
308 | 465 | // target met. we have just provided a render with the target size and | 442 | // target met. we have just provided a render with the target size and |
309 | 466 | // can therefore finally rest. | 443 | // can therefore finally rest. |
310 | 467 | 444 | ||
311 | === modified file 'src/ubuntumirclient/window.h' | |||
312 | --- src/ubuntumirclient/window.h 2015-02-04 16:14:43 +0000 | |||
313 | +++ src/ubuntumirclient/window.h 2015-06-03 13:24:47 +0000 | |||
314 | @@ -49,10 +49,6 @@ | |||
315 | 49 | 49 | ||
316 | 50 | UbuntuWindowPrivate* priv() { return d; } | 50 | UbuntuWindowPrivate* priv() { return d; } |
317 | 51 | 51 | ||
318 | 52 | public Q_SLOTS: | ||
319 | 53 | void handleBufferResize(int width, int height); | ||
320 | 54 | void forceRedraw(); | ||
321 | 55 | |||
322 | 56 | private: | 52 | private: |
323 | 57 | void createWindow(); | 53 | void createWindow(); |
324 | 58 | void moveResize(const QRect& rect); | 54 | void moveResize(const QRect& rect); |
PASSED: Continuous integration, rev:259 jenkins. qa.ubuntu. com/job/ qtubuntu- ci/208/ jenkins. qa.ubuntu. com/job/ qtubuntu- vivid-armhf- ci/34 jenkins. qa.ubuntu. com/job/ qtubuntu- vivid-armhf- ci/34/artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtubuntu- ci/208/ rebuild
http://