Merge lp:~mzanetti/qtmir/surfacemanager-getters into lp:qtmir

Proposed by Michael Zanetti
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 442
Merged at revision: 455
Proposed branch: lp:~mzanetti/qtmir/surfacemanager-getters
Merge into: lp:qtmir
Diff against target: 66 lines (+20/-1)
2 files modified
src/modules/Unity/Application/mirsurfacemanager.cpp (+15/-0)
src/modules/Unity/Application/mirsurfacemanager.h (+5/-1)
To merge this branch: bzr merge lp:~mzanetti/qtmir/surfacemanager-getters
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel d'Andrada (community) Approve
Unity8 CI Bot (community) continuous-integration Needs Fixing
Review via email: mp+286074@code.launchpad.net

Commit message

Add a dedicated property for the inputMethodSurface

When we're hot-plugging screens, the OSK ui might only be created after surfaceCreated() is emitted and we miss that signal.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

https://code.launchpad.net/~mzanetti/unity8/catch-osk/+merge/286076

 * Did you perform an exploratory manual test run of your code change and any related functionality?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

n/a

To post a comment you must log in.
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Where's the checklist?

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Where's the checklist?

I had to submit the other first before being able to fill in the checklist

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
441. By Michael Zanetti

add a inputMethodSurface property

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

Please update the commit message

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

In MirSurfaceManager::onSessionDestroyingSurface:

"""
    if (qmlSurface->type() == Mir::InputMethodType) {
        qmlSurface = nullptr;
        Q_EMIT inputMethodSurfaceChanged();
    }
"""

s/qmlSurface/m_inputMethodSurface

review: Needs Fixing
442. By Michael Zanetti

fix typo

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Works great!

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

* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, fixes the bug it claims to.

* Did CI run pass? If not, please explain why.
No due to some internal CI build issues (Errors were encountered while processing: libuuid1)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
443. By Michael Zanetti

merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp'
2--- src/modules/Unity/Application/mirsurfacemanager.cpp 2016-02-11 11:58:16 +0000
3+++ src/modules/Unity/Application/mirsurfacemanager.cpp 2016-02-16 13:34:50 +0000
4@@ -114,6 +114,11 @@
5 if (session)
6 session->registerSurface(qmlSurface);
7
8+ if (qmlSurface->type() == Mir::InputMethodType) {
9+ m_inputMethodSurface = qmlSurface;
10+ Q_EMIT inputMethodSurfaceChanged();
11+ }
12+
13 // Only notify QML of surface creation once it has drawn its first frame.
14 connect(qmlSurface, &MirSurfaceInterface::firstFrameDrawn, this, [=]() {
15 tracepoint(qtmir, firstFrameDrawn);
16@@ -155,8 +160,18 @@
17 }
18 }
19
20+ if (qmlSurface->type() == Mir::InputMethodType) {
21+ m_inputMethodSurface = nullptr;
22+ Q_EMIT inputMethodSurfaceChanged();
23+ }
24+
25 qmlSurface->setLive(false);
26 Q_EMIT surfaceDestroyed(qmlSurface);
27 }
28
29+MirSurfaceInterface* MirSurfaceManager::inputMethodSurface() const
30+{
31+ return m_inputMethodSurface;
32+}
33+
34 } // namespace qtmir
35
36=== modified file 'src/modules/Unity/Application/mirsurfacemanager.h'
37--- src/modules/Unity/Application/mirsurfacemanager.h 2016-02-11 11:58:16 +0000
38+++ src/modules/Unity/Application/mirsurfacemanager.h 2016-02-16 13:34:50 +0000
39@@ -54,7 +54,7 @@
40 class MirSurfaceManager : public QObject
41 {
42 Q_OBJECT
43-
44+ Q_PROPERTY(MirSurfaceInterface* inputMethodSurface READ inputMethodSurface NOTIFY inputMethodSurfaceChanged)
45 public:
46 explicit MirSurfaceManager(
47 const QSharedPointer<MirServer>& mirServer,
48@@ -66,7 +66,10 @@
49
50 static MirSurfaceManager* singleton();
51
52+ MirSurfaceInterface* inputMethodSurface() const;
53+
54 Q_SIGNALS:
55+ void inputMethodSurfaceChanged();
56 void surfaceCreated(MirSurfaceInterface* surface);
57 void surfaceDestroyed(MirSurfaceInterface* surface);
58
59@@ -86,6 +89,7 @@
60 mir::shell::Shell *const m_shell;
61 SessionManager* m_sessionManager;
62 static MirSurfaceManager *instance;
63+ MirSurfaceInterface* m_inputMethodSurface = nullptr;
64 };
65
66 } // namespace qtmir

Subscribers

People subscribed via source and target branches