Merge lp:~aacid/ubuntu-ui-toolkit/xvfb_pixels_per_mm into lp:ubuntu-ui-toolkit/staging

Proposed by Albert Astals Cid on 2016-01-11
Status: Merged
Approved by: Zsombor Egri on 2016-01-11
Approved revision: 1801
Merged at revision: 1801
Proposed branch: lp:~aacid/ubuntu-ui-toolkit/xvfb_pixels_per_mm
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 21 lines (+7/-4)
1 file modified
src/Ubuntu/UbuntuGestures/ucswipearea.cpp (+7/-4)
To merge this branch: bzr merge lp:~aacid/ubuntu-ui-toolkit/xvfb_pixels_per_mm
Reviewer Review Type Date Requested Status
Zsombor Egri (community) 2016-01-11 Approve on 2016-01-11
PS Jenkins bot continuous-integration Approve on 2016-01-11
Review via email: mp+282149@code.launchpad.net

Commit Message

Have a default pixelsPerInch value

Otherwise when running unity8 tests under xvfb we get the wrong parameters warning and tests fail

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/UbuntuGestures/ucswipearea.cpp'
2--- src/Ubuntu/UbuntuGestures/ucswipearea.cpp 2015-12-17 15:23:26 +0000
3+++ src/Ubuntu/UbuntuGestures/ucswipearea.cpp 2016-01-11 09:29:29 +0000
4@@ -813,10 +813,13 @@
5
6 // FIXME: Handle window->screen() changes (ie window changing screens)
7 Q_D(UCSwipeArea);
8- qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;
9- // FIXME: dpi can be negative lp#1525293
10- if (pixelsPerMm > 0)
11- d->setPixelsPerMm(pixelsPerMm);
12+ qreal pixelsPerInch = value.window->screen()->physicalDotsPerInch();
13+ if (pixelsPerInch < 0) {
14+ // FIXME: dpi can be negative lp#1525293
15+ // It can return garbage when run in a XVFB server (Virtual Framebuffer 'fake' X server)
16+ pixelsPerInch = 72;
17+ }
18+ d->setPixelsPerMm(pixelsPerInch / 25.4);
19 }
20 }
21 if (change == ItemVisibleHasChanged) {

Subscribers

People subscribed via source and target branches