Merge lp:~dandrader/qtmir/miral-smallFixes into lp:~unity-team/qtmir/miral-qt-integration

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Gerry Boland
Approved revision: 585
Merged at revision: 583
Proposed branch: lp:~dandrader/qtmir/miral-smallFixes
Merge into: lp:~unity-team/qtmir/miral-qt-integration
Diff against target: 87 lines (+25/-20)
2 files modified
src/common/debughelpers.cpp (+11/-16)
src/modules/Unity/Application/mirsurface.cpp (+14/-4)
To merge this branch: bzr merge lp:~dandrader/qtmir/miral-smallFixes
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+311836@code.launchpad.net

Commit message

MirSurface: Improve logging and don't use miral::Window of a dead surface

+ Update mirSurfaceTypeToStr

Description of the change

Some small fixes

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

+ return "";
replacing this with a Q_UNREACHABLE() should compile.
Rest looks good

review: Needs Fixing
lp:~dandrader/qtmir/miral-smallFixes updated
585. By Daniel d'Andrada

use Q_UNREACHABLE()

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

On 25/11/2016 13:43, Gerry Boland wrote:
> Review: Needs Fixing
>
> + return "";
> replacing this with a Q_UNREACHABLE() should compile.
> Rest looks good

Done.

Revision history for this message
Gerry Boland (gerboland) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/common/debughelpers.cpp'
2--- src/common/debughelpers.cpp 2016-11-03 20:17:46 +0000
3+++ src/common/debughelpers.cpp 2016-11-25 15:46:29 +0000
4@@ -115,23 +115,18 @@
5 const char *mirSurfaceTypeToStr(int value)
6 {
7 switch (value) {
8- case mir_surface_type_normal:
9- return "normal";
10- case mir_surface_type_utility:
11- return "utility";
12- case mir_surface_type_dialog:
13- return "dialog";
14- case mir_surface_type_overlay:
15- return "overlay";
16- case mir_surface_type_freestyle:
17- return "freestyle";
18- case mir_surface_type_popover:
19- return "popover";
20- case mir_surface_type_inputmethod:
21- return "inputmethod";
22- default:
23- return "???";
24+ case mir_surface_type_normal: return "normal"; /**< AKA "regular" */
25+ case mir_surface_type_utility: return "utility"; /**< AKA "floating regular" */
26+ case mir_surface_type_dialog: return "dialog";
27+ case mir_surface_type_gloss: return "gloss";
28+ case mir_surface_type_freestyle: return "freestyle";
29+ case mir_surface_type_menu: return "menu";
30+ case mir_surface_type_inputmethod: return "input Method"; /**< AKA "OSK" or handwriting etc. */
31+ case mir_surface_type_satellite: return "satellite"; /**< AKA "toolbox"/"toolbar" */
32+ case mir_surface_type_tip: return "tip"; /**< AKA "tooltip" */
33+ case mir_surface_types: Q_UNREACHABLE();
34 }
35+ Q_UNREACHABLE();
36 }
37
38 const char *mirSurfaceStateToStr(int value)
39
40=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
41--- src/modules/Unity/Application/mirsurface.cpp 2016-11-22 18:01:11 +0000
42+++ src/modules/Unity/Application/mirsurface.cpp 2016-11-25 15:46:29 +0000
43@@ -134,7 +134,10 @@
44 , m_state(toQtState(newWindowInfo.windowInfo.state()))
45 , m_shellChrome(Mir::NormalChrome)
46 {
47- DEBUG_MSG << "()";
48+ DEBUG_MSG << "("
49+ << "type=" << mirSurfaceTypeToStr(m_type)
50+ << ",state=" << unityapiMirStateToStr(m_state)
51+ << ")";
52
53 SurfaceObserver::registerObserverForSurface(m_surfaceObserver.get(), m_surface.get());
54 m_surface->add_observer(m_surfaceObserver);
55@@ -903,7 +906,9 @@
56 void MirSurface::activate()
57 {
58 DEBUG_MSG << "()";
59- m_controller->activate(m_window);
60+ if (m_live) {
61+ m_controller->activate(m_window);
62+ }
63 }
64
65 void MirSurface::onCloseTimedOut()
66@@ -914,7 +919,9 @@
67
68 m_closingState = CloseOverdue;
69
70- m_controller->forceClose(m_window);
71+ if (m_live) {
72+ m_controller->forceClose(m_window);
73+ }
74 }
75
76 void MirSurface::setCloseTimer(AbstractTimer *timer)
77@@ -960,7 +967,10 @@
78 if (point != m_requestedPosition) {
79 m_requestedPosition = point;
80 Q_EMIT requestedPositionChanged(m_requestedPosition);
81- m_controller->move(m_window, m_requestedPosition);
82+
83+ if (m_live) {
84+ m_controller->move(m_window, m_requestedPosition);
85+ }
86 }
87 }
88

Subscribers

People subscribed via source and target branches

to all changes: