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
=== modified file 'src/common/debughelpers.cpp'
--- src/common/debughelpers.cpp 2016-11-03 20:17:46 +0000
+++ src/common/debughelpers.cpp 2016-11-25 15:46:29 +0000
@@ -115,23 +115,18 @@
115const char *mirSurfaceTypeToStr(int value)115const char *mirSurfaceTypeToStr(int value)
116{116{
117 switch (value) {117 switch (value) {
118 case mir_surface_type_normal:118 case mir_surface_type_normal: return "normal"; /**< AKA "regular" */
119 return "normal";119 case mir_surface_type_utility: return "utility"; /**< AKA "floating regular" */
120 case mir_surface_type_utility:120 case mir_surface_type_dialog: return "dialog";
121 return "utility";121 case mir_surface_type_gloss: return "gloss";
122 case mir_surface_type_dialog:122 case mir_surface_type_freestyle: return "freestyle";
123 return "dialog";123 case mir_surface_type_menu: return "menu";
124 case mir_surface_type_overlay:124 case mir_surface_type_inputmethod: return "input Method"; /**< AKA "OSK" or handwriting etc. */
125 return "overlay";125 case mir_surface_type_satellite: return "satellite"; /**< AKA "toolbox"/"toolbar" */
126 case mir_surface_type_freestyle:126 case mir_surface_type_tip: return "tip"; /**< AKA "tooltip" */
127 return "freestyle";127 case mir_surface_types: Q_UNREACHABLE();
128 case mir_surface_type_popover:
129 return "popover";
130 case mir_surface_type_inputmethod:
131 return "inputmethod";
132 default:
133 return "???";
134 }128 }
129 Q_UNREACHABLE();
135}130}
136131
137const char *mirSurfaceStateToStr(int value)132const char *mirSurfaceStateToStr(int value)
138133
=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
--- src/modules/Unity/Application/mirsurface.cpp 2016-11-22 18:01:11 +0000
+++ src/modules/Unity/Application/mirsurface.cpp 2016-11-25 15:46:29 +0000
@@ -134,7 +134,10 @@
134 , m_state(toQtState(newWindowInfo.windowInfo.state()))134 , m_state(toQtState(newWindowInfo.windowInfo.state()))
135 , m_shellChrome(Mir::NormalChrome)135 , m_shellChrome(Mir::NormalChrome)
136{136{
137 DEBUG_MSG << "()";137 DEBUG_MSG << "("
138 << "type=" << mirSurfaceTypeToStr(m_type)
139 << ",state=" << unityapiMirStateToStr(m_state)
140 << ")";
138141
139 SurfaceObserver::registerObserverForSurface(m_surfaceObserver.get(), m_surface.get());142 SurfaceObserver::registerObserverForSurface(m_surfaceObserver.get(), m_surface.get());
140 m_surface->add_observer(m_surfaceObserver);143 m_surface->add_observer(m_surfaceObserver);
@@ -903,7 +906,9 @@
903void MirSurface::activate()906void MirSurface::activate()
904{907{
905 DEBUG_MSG << "()";908 DEBUG_MSG << "()";
906 m_controller->activate(m_window);909 if (m_live) {
910 m_controller->activate(m_window);
911 }
907}912}
908913
909void MirSurface::onCloseTimedOut()914void MirSurface::onCloseTimedOut()
@@ -914,7 +919,9 @@
914919
915 m_closingState = CloseOverdue;920 m_closingState = CloseOverdue;
916921
917 m_controller->forceClose(m_window);922 if (m_live) {
923 m_controller->forceClose(m_window);
924 }
918}925}
919926
920void MirSurface::setCloseTimer(AbstractTimer *timer)927void MirSurface::setCloseTimer(AbstractTimer *timer)
@@ -960,7 +967,10 @@
960 if (point != m_requestedPosition) {967 if (point != m_requestedPosition) {
961 m_requestedPosition = point;968 m_requestedPosition = point;
962 Q_EMIT requestedPositionChanged(m_requestedPosition);969 Q_EMIT requestedPositionChanged(m_requestedPosition);
963 m_controller->move(m_window, m_requestedPosition);970
971 if (m_live) {
972 m_controller->move(m_window, m_requestedPosition);
973 }
964 }974 }
965}975}
966976

Subscribers

People subscribed via source and target branches

to all changes: