Merge lp:~osomon/qtubuntu/ubuntuscreen-physicalsize into lp:qtubuntu

Proposed by Olivier Tilloy
Status: Merged
Approved by: Gerry Boland
Approved revision: 281
Merged at revision: 285
Proposed branch: lp:~osomon/qtubuntu/ubuntuscreen-physicalsize
Merge into: lp:qtubuntu
Diff against target: 47 lines (+7/-2)
2 files modified
src/ubuntumirclient/screen.cpp (+4/-1)
src/ubuntumirclient/screen.h (+3/-1)
To merge this branch: bzr merge lp:~osomon/qtubuntu/ubuntuscreen-physicalsize
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+273965@code.launchpad.net

Commit message

Re-implement QPlatformScreen::physicalSize().

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:281
http://jenkins.qa.ubuntu.com/job/qtubuntu-ci/257/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/qtubuntu-ci/257/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Tested on 3 devices, and I’m getting correct pixel density values:

  arale: 19.104950495049504 px/mm
  krillin: 9.48931735278791 px/mm
  flo: 12.673405367723944 px/mm

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntumirclient/screen.cpp'
2--- src/ubuntumirclient/screen.cpp 2015-08-06 14:14:39 +0000
3+++ src/ubuntumirclient/screen.cpp 2015-10-09 10:58:12 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2014 Canonical, Ltd.
7+ * Copyright (C) 2014-2015 Canonical, Ltd.
8 *
9 * This program is free software: you can redistribute it and/or modify it under
10 * the terms of the GNU Lesser General Public License version 3, as published by
11@@ -182,6 +182,9 @@
12 auto const displayOutput = find_active_output(displayConfig.get());
13 ASSERT(displayOutput != nullptr);
14
15+ mPhysicalSize = QSizeF(displayOutput->physical_width_mm, displayOutput->physical_height_mm);
16+ DLOG("ubuntumirclient: screen physical size: %.2fx%.2f", mPhysicalSize.width(), mPhysicalSize.height());
17+
18 const MirDisplayMode *mode = &displayOutput->modes[displayOutput->current_mode];
19 const int kScreenWidth = mode->horizontal_resolution;
20 const int kScreenHeight = mode->vertical_resolution;
21
22=== modified file 'src/ubuntumirclient/screen.h'
23--- src/ubuntumirclient/screen.h 2015-06-23 22:19:27 +0000
24+++ src/ubuntumirclient/screen.h 2015-10-09 10:58:12 +0000
25@@ -1,5 +1,5 @@
26 /*
27- * Copyright (C) 2014 Canonical, Ltd.
28+ * Copyright (C) 2014-2015 Canonical, Ltd.
29 *
30 * This program is free software: you can redistribute it and/or modify it under
31 * the terms of the GNU Lesser General Public License version 3, as published by
32@@ -35,6 +35,7 @@
33 int depth() const override { return mDepth; }
34 QRect geometry() const override { return mGeometry; }
35 QRect availableGeometry() const override { return mGeometry; }
36+ QSizeF physicalSize() const override { return mPhysicalSize; }
37 Qt::ScreenOrientation nativeOrientation() const override { return mNativeOrientation; }
38 Qt::ScreenOrientation orientation() const override { return mNativeOrientation; }
39
40@@ -50,6 +51,7 @@
41
42 private:
43 QRect mGeometry;
44+ QSizeF mPhysicalSize;
45 Qt::ScreenOrientation mNativeOrientation;
46 Qt::ScreenOrientation mCurrentOrientation;
47 QImage::Format mFormat;

Subscribers

People subscribed via source and target branches