Merge lp:~afrantzis/unity-mir/fix-1332624-input-area into lp:unity-mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Gerry Boland
Approved revision: 238
Merged at revision: 238
Proposed branch: lp:~afrantzis/unity-mir/fix-1332624-input-area
Merge into: lp:unity-mir
Diff against target: 20 lines (+4/-5)
1 file modified
src/modules/Unity/Application/inputarea.cpp (+4/-5)
To merge this branch: bzr merge lp:~afrantzis/unity-mir/fix-1332624-input-area
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Mir development team Pending
Review via email: mp+224768@code.launchpad.net

Commit message

Use surface relative coordinates when setting the input region for the input area

Mir changed at some point to use surface relative coordinates for input regions.

Description of the change

Use surface relative coordinates when setting the input region for the input area

Mir changed at some point to use surface relative coordinates for input regions. At the same time the input area surface placement changed to be below the top bar, making the distinction between relative and absolute coordinates relevant.

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
Gerry Boland (gerboland) wrote :

This indeed fixes the bug, and code change makes sense with Mir update. Thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/inputarea.cpp'
2--- src/modules/Unity/Application/inputarea.cpp 2014-04-10 16:58:34 +0000
3+++ src/modules/Unity/Application/inputarea.cpp 2014-06-27 08:47:32 +0000
4@@ -178,12 +178,11 @@
5 {
6 DLOG("InputArea::setMirInputArea (this=%p, x=%lf, y=%lf, width=%lf, height=%lf)", this, relativeGeometry.x(), relativeGeometry.y(), relativeGeometry.width(), relativeGeometry.height());
7 using namespace mir::geometry;
8- const QRect rect = parentItem()->mapRectToScene(relativeGeometry).toRect();
9
10- m_mirInputArea.top_left.x = X{rect.x()};
11- m_mirInputArea.top_left.y = Y{rect.y()};
12- m_mirInputArea.size.width = Width{rect.width()};
13- m_mirInputArea.size.height = Height{rect.height()};
14+ m_mirInputArea.top_left.x = X{relativeGeometry.x()};
15+ m_mirInputArea.top_left.y = Y{relativeGeometry.y()};
16+ m_mirInputArea.size.width = Width{relativeGeometry.width()};
17+ m_mirInputArea.size.height = Height{relativeGeometry.height()};
18
19 if (m_surface) {
20 m_surface->installInputArea(this);

Subscribers

People subscribed via source and target branches