Merge lp:~saviq/unity-mir/fix-inputarea into lp:unity-mir

Proposed by Michał Sawicz
Status: Merged
Approved by: Gerry Boland
Approved revision: 102
Merged at revision: 101
Proposed branch: lp:~saviq/unity-mir/fix-inputarea
Merge into: lp:unity-mir
Diff against target: 23 lines (+4/-2)
1 file modified
src/modules/Unity/Application/inputarea.cpp (+4/-2)
To merge this branch: bzr merge lp:~saviq/unity-mir/fix-inputarea
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Daniel d'Andrada (community) Approve
Review via email: mp+189647@code.launchpad.net

Commit message

Map rect to scene in setMirInputArea and set the geometry onEnabled.

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
Daniel d'Andrada (dandrader) wrote :

9 + setMirInputArea(m_geometry);

Speaking of setMirInputArea, should it call "m_surface->removeInputArea(this);" before "m_surface->installInputArea(this);", like InputArea::doSetSurface does?

Because MirSurface::installInputArea() appends the given area to an internal list of areas.

I know it's not the objective of your patch to fix it but still, we should let it pass if it's indeed wrong.

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> [...]
> I know it's not the objective of your patch to fix it but still, we should let
> it pass if it's indeed wrong.

s/should/shouldn't

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Looking at it better, this is not a problem since it's sending a pointer to the inputarea class instead of sending the geometry directly

review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote :

We're looking whether this caused input to fall through the OSK when in shell.

Revision history for this message
Michał Sawicz (saviq) wrote :

Confirmed, need to see how this can affect maliit.

lp:~saviq/unity-mir/fix-inputarea updated
101. By Michał Sawicz

Fix *for real*.

102. By Michał Sawicz

No need to store the parent.

Revision history for this message
Michał Sawicz (saviq) wrote :

Fixed.

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

Works, thanks!

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 2013-08-29 14:46:43 +0000
3+++ src/modules/Unity/Application/inputarea.cpp 2013-10-07 21:14:57 +0000
4@@ -58,6 +58,9 @@
5
6 if (enabled != m_enabled) {
7 m_enabled = enabled;
8+ if (m_enabled) {
9+ setMirInputArea(m_geometry);
10+ }
11 if (m_surface) {
12 m_surface->enableInputArea(this, enabled);
13 }
14@@ -161,8 +164,7 @@
15 {
16 DLOG("InputArea::setMirInputArea (this=%p, x=%lf, y=%lf, width=%lf, height=%lf)", this, relativeGeometry.x(), relativeGeometry.y(), relativeGeometry.width(), relativeGeometry.height());
17 using namespace mir::geometry;
18- //FIXME(greyback) mapping geometry to scene giving wrong output, figure out why
19- const QRect rect = relativeGeometry.toRect();
20+ const QRect rect = parentItem()->mapRectToScene(relativeGeometry).toRect();
21
22 m_mirInputArea.top_left.x = X{rect.x()};
23 m_mirInputArea.top_left.y = Y{rect.y()};

Subscribers

People subscribed via source and target branches