Merge lp:~unity-team/unity/trusty-1374785 into lp:unity/7.2

Proposed by Stephen M. Webb
Status: Rejected
Rejected by: Stephen M. Webb
Proposed branch: lp:~unity-team/unity/trusty-1374785
Merge into: lp:unity/7.2
Diff against target: 58 lines (+30/-3)
2 files modified
debian/changelog (+6/-0)
unity-shared/UScreen.cpp (+24/-3)
To merge this branch: bzr merge lp:~unity-team/unity/trusty-1374785
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+244201@code.launchpad.net

This proposal supersedes a proposal from 2014-12-09.

Description of the change

Make sure GetScreenGeometry returns the correct value (fixes #1374785).

This fix is cherry-picked from trunk for SRUing into Ubuntu 14.04 LTS.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-08-26 13:49:00 +0000
+++ debian/changelog 2014-12-09 18:53:08 +0000
@@ -1,3 +1,9 @@
1unity (7.2.3+14.04.20140826-0ubuntu2) UNRELEASED; urgency=medium
2
3 * Make sure GetScreenGeometry returns the correct value (lp: #1374785).
4
5 -- Andrea Azzarone <azzaronea@gmail.com> Tue, 09 Dec 2014 13:49:07 -0500
6
1unity (7.2.3+14.04.20140826-0ubuntu1) trusty; urgency=medium7unity (7.2.3+14.04.20140826-0ubuntu1) trusty; urgency=medium
28
3 [ Andrea Azzarone ]9 [ Andrea Azzarone ]
410
=== modified file 'unity-shared/UScreen.cpp'
--- unity-shared/UScreen.cpp 2014-04-08 16:29:49 +0000
+++ unity-shared/UScreen.cpp 2014-12-09 18:53:08 +0000
@@ -80,6 +80,15 @@
8080
81int UScreen::GetMonitorAtPosition(int x, int y) const81int UScreen::GetMonitorAtPosition(int x, int y) const
82{82{
83 int idx = 0;
84
85 for (auto const& monitor : monitors_)
86 {
87 if (monitor.IsPointInside(x, y))
88 return idx;
89 ++idx;
90 }
91
83 return gdk_screen_get_monitor_at_point(screen_, x, y);92 return gdk_screen_get_monitor_at_point(screen_, x, y);
84}93}
8594
@@ -95,9 +104,21 @@
95104
96nux::Geometry UScreen::GetScreenGeometry() const105nux::Geometry UScreen::GetScreenGeometry() const
97{106{
98 int width = gdk_screen_get_width(screen_);107 if (monitors_.empty())
99 int height = gdk_screen_get_height(screen_);108 return {};
100 return nux::Geometry(0, 0, width, height);109
110 auto rightmost_geo = max_element(monitors_.begin(), monitors_.end(), [](nux::Geometry const& a, nux::Geometry const& b) {
111 return a.x + a.width < b.x + b.width;
112 });
113
114 auto lower_geo = max_element(monitors_.begin(), monitors_.end(), [](nux::Geometry const& a, nux::Geometry const& b) {
115 return a.y + a.height < b.y + b.height;
116 });
117
118 auto width = rightmost_geo->x + rightmost_geo->width;
119 auto height = lower_geo->y + lower_geo->height;
120
121 return {0, 0, width, height};
101}122}
102123
103const std::string UScreen::GetMonitorName(int output_number = 0) const124const std::string UScreen::GetMonitorName(int output_number = 0) const

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: