Merge lp:~unity-team/qtmir/liveCaption into lp:qtmir

Proposed by Michał Sawicz
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 391
Merged at revision: 393
Proposed branch: lp:~unity-team/qtmir/liveCaption
Merge into: lp:qtmir
Prerequisite: lp:~alan-griffiths/qtmir/small-refactoring-of-MirWindowManager
Diff against target: 127 lines (+23/-10)
6 files modified
CMakeLists.txt (+1/-1)
debian/control (+1/-1)
src/modules/Unity/Application/mirsurface.cpp (+1/-1)
src/platforms/mirserver/mirwindowmanager.cpp (+12/-5)
src/platforms/mirserver/surfaceobserver.cpp (+5/-0)
src/platforms/mirserver/surfaceobserver.h (+3/-2)
To merge this branch: bzr merge lp:~unity-team/qtmir/liveCaption
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel d'Andrada (community) Approve
Gerry Boland Pending
Review via email: mp+273071@code.launchpad.net

Commit message

React to surface modifications (window caption)

Description of the change

React to surface modifications (window caption)

Cf. https://bugs.launchpad.net/ubuntu/+source/unity-api/+bug/1497092

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

Yes, build depends on this unity-api MP: https://code.launchpad.net/~lukas-kde/unity-api/liveCaption/+merge/272769
Functionality-wise, also depends on qtubuntu MP: https://code.launchpad.net/~lukas-kde/qtubuntu/liveCaption/+merge/272756

To actually see the results you also need: https://code.launchpad.net/~lukas-kde/unity8/liveCaption/+merge/272760

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

Yes

* Did you make sure that your branch does not contain spurious tags?

Yes

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

Yes

* If you changed the UI, has there been a design review?

N/A

To post a comment you must log in.
Revision history for this message
Daniel d'Andrada (dandrader) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-10-01 14:03:32 +0000
3+++ CMakeLists.txt 2015-10-01 14:03:32 +0000
4@@ -75,7 +75,7 @@
5 pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
6 pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED)
7 pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED)
8-pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=8)
9+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=9)
10
11 include_directories(${APPLICATION_API_INCLUDE_DIRS})
12
13
14=== modified file 'debian/control'
15--- debian/control 2015-09-25 12:11:08 +0000
16+++ debian/control 2015-10-01 14:03:32 +0000
17@@ -93,7 +93,7 @@
18 Conflicts: libqtmir,
19 libunity-mir1,
20 Provides: unity-application-impl,
21- unity-application-impl-8,
22+ unity-application-impl-9,
23 Description: Qt plugin for Unity specific Mir APIs
24 QtMir provides Qt/QML bindings for Mir features that are exposed through the
25 qtmir-desktop or qtmir-android QPA plugin such as Application management
26
27=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
28--- src/modules/Unity/Application/mirsurface.cpp 2015-09-18 16:33:06 +0000
29+++ src/modules/Unity/Application/mirsurface.cpp 2015-10-01 14:03:32 +0000
30@@ -158,6 +158,7 @@
31 if (observer) {
32 connect(observer.get(), &SurfaceObserver::framesPosted, this, &MirSurface::onFramesPostedObserved);
33 connect(observer.get(), &SurfaceObserver::attributeChanged, this, &MirSurface::onAttributeChanged);
34+ connect(observer.get(), &SurfaceObserver::nameChanged, this, &MirSurface::nameChanged);
35 observer->setListener(this);
36 }
37
38@@ -468,7 +469,6 @@
39
40 QString MirSurface::name() const
41 {
42- //FIXME - how to listen to change in this property?
43 return QString::fromStdString(m_surface->name());
44 }
45
46
47=== modified file 'src/platforms/mirserver/mirwindowmanager.cpp'
48--- src/platforms/mirserver/mirwindowmanager.cpp 2015-10-01 14:03:32 +0000
49+++ src/platforms/mirserver/mirwindowmanager.cpp 2015-10-01 14:03:32 +0000
50@@ -26,7 +26,7 @@
51
52 namespace ms = mir::scene;
53
54-namespace
55+namespace
56 {
57 class MirWindowManagerImpl : public MirWindowManager
58 {
59@@ -63,7 +63,10 @@
60 MirSurfaceAttrib attrib,
61 int value) override;
62
63- void modify_surface(const std::shared_ptr<mir::scene::Session>&, const std::shared_ptr<mir::scene::Surface>&, const mir::shell::SurfaceSpecification&);
64+ void modify_surface(
65+ const std::shared_ptr<mir::scene::Session>&,
66+ const std::shared_ptr<mir::scene::Surface>& surface,
67+ const mir::shell::SurfaceSpecification& modifications) override;
68
69 private:
70 std::shared_ptr<mir::shell::DisplayLayout> const m_displayLayout;
71@@ -150,13 +153,17 @@
72 return surface->configure(attrib, value);
73 }
74
75-void MirWindowManagerImpl::modify_surface(const std::shared_ptr<mir::scene::Session>&, const std::shared_ptr<mir::scene::Surface>&, const mir::shell::SurfaceSpecification&)
76+void MirWindowManagerImpl::modify_surface(const std::shared_ptr<mir::scene::Session>&,
77+ const std::shared_ptr<mir::scene::Surface>& surface,
78+ const mir::shell::SurfaceSpecification& modifications)
79 {
80- // TODO support surface modifications
81+ if (modifications.name.is_set()) {
82+ surface->rename(modifications.name.value());
83+ }
84 }
85
86 std::unique_ptr<MirWindowManager> MirWindowManager::create(
87- mir::shell::FocusController* /*focus_controller*/,
88+ mir::shell::FocusController* /*focus_controller*/,
89 const std::shared_ptr<mir::shell::DisplayLayout> &displayLayout)
90 {
91 return std::make_unique<MirWindowManagerImpl>(displayLayout);
92
93=== modified file 'src/platforms/mirserver/surfaceobserver.cpp'
94--- src/platforms/mirserver/surfaceobserver.cpp 2015-08-31 09:51:28 +0000
95+++ src/platforms/mirserver/surfaceobserver.cpp 2015-10-01 14:03:32 +0000
96@@ -42,6 +42,11 @@
97 }
98 }
99
100+void SurfaceObserver::renamed(char const * name)
101+{
102+ Q_EMIT nameChanged(QString::fromUtf8(name));
103+}
104+
105 void SurfaceObserver::attrib_changed(MirSurfaceAttrib attribute, int value)
106 {
107 if (m_listener) {
108
109=== modified file 'src/platforms/mirserver/surfaceobserver.h'
110--- src/platforms/mirserver/surfaceobserver.h 2015-08-31 09:51:28 +0000
111+++ src/platforms/mirserver/surfaceobserver.h 2015-10-01 14:03:32 +0000
112@@ -45,12 +45,13 @@
113 void orientation_set_to(MirOrientation) override {}
114 void client_surface_close_requested() override {}
115 void keymap_changed(xkb_rule_names const &) override {}
116- void renamed(char const *) override {}
117+ void renamed(char const * name) override;
118
119 Q_SIGNALS:
120 void attributeChanged(const MirSurfaceAttrib attribute, const int value);
121 void framesPosted();
122- void resized(QSize size);
123+ void resized(const QSize &size);
124+ void nameChanged(const QString &name);
125
126 private:
127 QObject *m_listener;

Subscribers

People subscribed via source and target branches