From 29d988cd7fe72889d76f21fcc83a175162522b06 Mon Sep 17 00:00:00 2001 From: ubuntu1804 Date: Tue, 11 Nov 2025 15:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96PowerMonitor=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/powermonitor.cpp | 12 +++++++++--- src/vulkanwidget.cpp | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/powermonitor.cpp b/src/powermonitor.cpp index 20c6faf..a3958ff 100644 --- a/src/powermonitor.cpp +++ b/src/powermonitor.cpp @@ -23,14 +23,18 @@ void PowerMonitor::initLogin1Dbus() { ); if (connectOk) { + qDebug() << "================================================="; qDebug() << "✅ 成功连接 login1 电源管理接口"; + qDebug() << "================================================="; } else { + qDebug() << "================================================="; qDebug() << "❌ 连接 login1 信号失败:" << QDBusConnection::systemBus().lastError().message(); + qDebug() << "================================================="; } } else { + qDebug() << "================================================="; qDebug() << "❌ 无法创建 login1 接口:" << m_login1Interface->lastError().message(); - // 可选:fallback 到 GNOME 专用会话管理接口(见下文) - // initGnomeSessionManager(); + qDebug() << "================================================="; } } @@ -38,11 +42,13 @@ void PowerMonitor::initLogin1Dbus() { void PowerMonitor::onPrepareForSleep(bool enteringSleep) { if (enteringSleep) { // 系统即将进入 休眠/待机 状态 + qDebug() << "================================================="; qDebug() << "\n📥 系统即将进入睡眠(休眠/待机)"; emit aboutToSleep(); } else { // 系统从睡眠中唤醒 - qDebug() << "📤 系统已从睡眠中唤醒"; + qDebug() << "📤 系统已从睡眠中唤醒\n"; + qDebug() << "================================================="; emit aboutToWakeUp(); } } diff --git a/src/vulkanwidget.cpp b/src/vulkanwidget.cpp index 701ead7..91b5de7 100644 --- a/src/vulkanwidget.cpp +++ b/src/vulkanwidget.cpp @@ -788,7 +788,7 @@ void VulkanWidget::renderFrame() recreateSwapchain(); return; } else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) { - qDebug() << "Failed to acquire swapchain image"; + //qDebug() << "Failed to acquire swapchain image"; return; } @@ -817,7 +817,7 @@ void VulkanWidget::renderFrame() result = vkQueueSubmit(m_queue, 1, &submitInfo, m_inFlightFences[m_currentFrame]); if (result != VK_SUCCESS) { - qDebug() << "Failed to submit draw command buffer"; + qDebug() << "Failed to submit draw command buffer! Error code = " << result; return; }