on xenial help sign in
Fix Window debug messages
067bf4dDaniel d'Andrada
plugins/WindowManager/Window.cpp+13−10
@@ -20,6 +20,7 @@
20#include <unity/shell/application/MirSurfaceInterface.h>
20#include <unity/shell/application/MirSurfaceInterface.h>
21
21
22#include <QQmlEngine>
22#include <QQmlEngine>
23+#include <QTextStream>
23
24
24namespace unityapi = unity::shell::application;
25namespace unityapi = unity::shell::application;
25
26
@@ -117,6 +118,7 @@ void Window::close()
117
118
118void Window::activate()
119void Window::activate()
119{
120{
121+ DEBUG_MSG << "()";
120 if (m_surface) {
122 if (m_surface) {
121 m_surface->activate();
123 m_surface->activate();
122 } else {
124 } else {
@@ -206,17 +208,18 @@ void Window::setFocused(bool value)
206
208
207QString Window::toString() const
209QString Window::toString() const
208{
210{
211+ QString result;
212+ {
213+ QTextStream stream(&result);
214+ stream << "Window["<<(void*)this<<", id="<<id()<<", ";
209− if (surface()) {
215+ if (surface()) {
210− return QString("Window[0x%1, id=%2, MirSurface[0x%3,\"%4\"]]").arg(
211− QString::number((quintptr)this, 16),
212− QString::number(id()),
213− QString::number((quintptr)surface(), 16),
214− surface()->name());
216+ stream << "MirSurface["<<(void*)surface()<<",\""<<surface()->name()<<"\"]";
215− } else {
217+ } else {
216− return QString("Window[0x%1, id=%2, null]").arg(
218+ stream << "null";
217− QString::number((quintptr)this, 0, 16),
219+ }
218− QString::number(id()));
220+ stream << "]";
219 }
221 }
222+ return result;
220}
223}
221
224
222QDebug operator<<(QDebug dbg, const Window *window)
225QDebug operator<<(QDebug dbg, const Window *window)