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
=== modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp'
--- src/modules/Unity/Application/mirsurfacemanager.cpp 2016-02-11 11:58:16 +0000
+++ src/modules/Unity/Application/mirsurfacemanager.cpp 2016-02-16 13:34:50 +0000
@@ -114,6 +114,11 @@
114 if (session)114 if (session)
115 session->registerSurface(qmlSurface);115 session->registerSurface(qmlSurface);
116116
117 if (qmlSurface->type() == Mir::InputMethodType) {
118 m_inputMethodSurface = qmlSurface;
119 Q_EMIT inputMethodSurfaceChanged();
120 }
121
117 // Only notify QML of surface creation once it has drawn its first frame.122 // Only notify QML of surface creation once it has drawn its first frame.
118 connect(qmlSurface, &MirSurfaceInterface::firstFrameDrawn, this, [=]() {123 connect(qmlSurface, &MirSurfaceInterface::firstFrameDrawn, this, [=]() {
119 tracepoint(qtmir, firstFrameDrawn);124 tracepoint(qtmir, firstFrameDrawn);
@@ -155,8 +160,18 @@
155 }160 }
156 }161 }
157162
163 if (qmlSurface->type() == Mir::InputMethodType) {
164 m_inputMethodSurface = nullptr;
165 Q_EMIT inputMethodSurfaceChanged();
166 }
167
158 qmlSurface->setLive(false);168 qmlSurface->setLive(false);
159 Q_EMIT surfaceDestroyed(qmlSurface);169 Q_EMIT surfaceDestroyed(qmlSurface);
160}170}
161171
172MirSurfaceInterface* MirSurfaceManager::inputMethodSurface() const
173{
174 return m_inputMethodSurface;
175}
176
162} // namespace qtmir177} // namespace qtmir
163178
=== modified file 'src/modules/Unity/Application/mirsurfacemanager.h'
--- src/modules/Unity/Application/mirsurfacemanager.h 2016-02-11 11:58:16 +0000
+++ src/modules/Unity/Application/mirsurfacemanager.h 2016-02-16 13:34:50 +0000
@@ -54,7 +54,7 @@
54class MirSurfaceManager : public QObject54class MirSurfaceManager : public QObject
55{55{
56 Q_OBJECT56 Q_OBJECT
5757 Q_PROPERTY(MirSurfaceInterface* inputMethodSurface READ inputMethodSurface NOTIFY inputMethodSurfaceChanged)
58public:58public:
59 explicit MirSurfaceManager(59 explicit MirSurfaceManager(
60 const QSharedPointer<MirServer>& mirServer,60 const QSharedPointer<MirServer>& mirServer,
@@ -66,7 +66,10 @@
6666
67 static MirSurfaceManager* singleton();67 static MirSurfaceManager* singleton();
6868
69 MirSurfaceInterface* inputMethodSurface() const;
70
69Q_SIGNALS:71Q_SIGNALS:
72 void inputMethodSurfaceChanged();
70 void surfaceCreated(MirSurfaceInterface* surface);73 void surfaceCreated(MirSurfaceInterface* surface);
71 void surfaceDestroyed(MirSurfaceInterface* surface);74 void surfaceDestroyed(MirSurfaceInterface* surface);
7275
@@ -86,6 +89,7 @@
86 mir::shell::Shell *const m_shell;89 mir::shell::Shell *const m_shell;
87 SessionManager* m_sessionManager;90 SessionManager* m_sessionManager;
88 static MirSurfaceManager *instance;91 static MirSurfaceManager *instance;
92 MirSurfaceInterface* m_inputMethodSurface = nullptr;
89};93};
9094
91} // namespace qtmir95} // namespace qtmir

Subscribers

People subscribed via source and target branches