Add some debug output for the window placement
authorKevin Ottens <kevin.ottens@nextcloud.com>
Thu, 11 Jun 2020 17:27:40 +0000 (19:27 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Mon, 15 Jun 2020 12:32:25 +0000 (12:32 +0000)
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/systray.cpp

index ebcefc4df302f4c1066b53412c5df589f24232e5..c67fa4bef1e9bd6185c25c58d567d2b32d26274b 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace OCC {
 
+Q_LOGGING_CATEGORY(lcSystray, "nextcloud.gui.systray")
+
 Systray *Systray::_instance = nullptr;
 
 Systray *Systray::instance()
@@ -254,6 +256,11 @@ QPoint Systray::computeWindowReferencePoint() const
     const auto taskbarScreenEdge = taskbarOrientation();
     const auto screenRect = currentScreenRect();
 
+    qCDebug(lcSystray) << "screenRect:" << screenRect;
+    qCDebug(lcSystray) << "taskbarRect:" << taskbarRect;
+    qCDebug(lcSystray) << "taskbarScreenEdge:" << taskbarScreenEdge;
+    qCDebug(lcSystray) << "trayIconCenter:" << trayIconCenter;
+
     switch(taskbarScreenEdge) {
     case TaskBarPosition::Bottom:
         return {
@@ -318,6 +325,12 @@ QPoint Systray::computeWindowPosition(int width, int height) const
 
         return rect.translated(offset);
     }();
+
+    qCDebug(lcSystray) << "taskbarScreenEdge:" << taskbarScreenEdge;
+    qCDebug(lcSystray) << "screenRect:" << screenRect;
+    qCDebug(lcSystray) << "windowRect (reference)" << QRect(topLeft, bottomRight);
+    qCDebug(lcSystray) << "windowRect (adjusted )" << windowRect;
+
     return windowRect.topLeft();
 }