优化PowerMonitor输出

This commit is contained in:
ubuntu1804 2025-11-11 15:57:11 +08:00
parent 2ec185654f
commit 29d988cd7f
2 changed files with 11 additions and 5 deletions

View File

@ -23,14 +23,18 @@ void PowerMonitor::initLogin1Dbus() {
); );
if (connectOk) { if (connectOk) {
qDebug() << "=================================================";
qDebug() << "✅ 成功连接 login1 电源管理接口"; qDebug() << "✅ 成功连接 login1 电源管理接口";
qDebug() << "=================================================";
} else { } else {
qDebug() << "=================================================";
qDebug() << "❌ 连接 login1 信号失败:" << QDBusConnection::systemBus().lastError().message(); qDebug() << "❌ 连接 login1 信号失败:" << QDBusConnection::systemBus().lastError().message();
qDebug() << "=================================================";
} }
} else { } else {
qDebug() << "=================================================";
qDebug() << "❌ 无法创建 login1 接口:" << m_login1Interface->lastError().message(); qDebug() << "❌ 无法创建 login1 接口:" << m_login1Interface->lastError().message();
// 可选fallback 到 GNOME 专用会话管理接口(见下文) qDebug() << "=================================================";
// initGnomeSessionManager();
} }
} }
@ -38,11 +42,13 @@ void PowerMonitor::initLogin1Dbus() {
void PowerMonitor::onPrepareForSleep(bool enteringSleep) { void PowerMonitor::onPrepareForSleep(bool enteringSleep) {
if (enteringSleep) { if (enteringSleep) {
// 系统即将进入 休眠/待机 状态 // 系统即将进入 休眠/待机 状态
qDebug() << "=================================================";
qDebug() << "\n📥 系统即将进入睡眠(休眠/待机)"; qDebug() << "\n📥 系统即将进入睡眠(休眠/待机)";
emit aboutToSleep(); emit aboutToSleep();
} else { } else {
// 系统从睡眠中唤醒 // 系统从睡眠中唤醒
qDebug() << "📤 系统已从睡眠中唤醒"; qDebug() << "📤 系统已从睡眠中唤醒\n";
qDebug() << "=================================================";
emit aboutToWakeUp(); emit aboutToWakeUp();
} }
} }

View File

@ -788,7 +788,7 @@ void VulkanWidget::renderFrame()
recreateSwapchain(); recreateSwapchain();
return; return;
} else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) { } else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
qDebug() << "Failed to acquire swapchain image"; //qDebug() << "Failed to acquire swapchain image";
return; return;
} }
@ -817,7 +817,7 @@ void VulkanWidget::renderFrame()
result = vkQueueSubmit(m_queue, 1, &submitInfo, m_inFlightFences[m_currentFrame]); result = vkQueueSubmit(m_queue, 1, &submitInfo, m_inFlightFences[m_currentFrame]);
if (result != VK_SUCCESS) { if (result != VK_SUCCESS) {
qDebug() << "Failed to submit draw command buffer"; qDebug() << "Failed to submit draw command buffer! Error code = " << result;
return; return;
} }