From 1874fd7f9393117950e3ddb2dc4d1a15f52db5cb Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 22 Jul 2023 01:53:39 +0800 Subject: [PATCH] Fix incorrect state Fix up f3f9cfe44ed49d5bf3de0e318fa9c8ec48645ca4. --- src/gui/powermanagement/powermanagement_x11.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/powermanagement/powermanagement_x11.cpp b/src/gui/powermanagement/powermanagement_x11.cpp index 6ade281fa..ed3b16079 100644 --- a/src/gui/powermanagement/powermanagement_x11.cpp +++ b/src/gui/powermanagement/powermanagement_x11.cpp @@ -80,15 +80,15 @@ void PowerManagementInhibitor::requestIdle() if ((m_state == Error) || (m_state == Idle) || (m_state == RequestIdle) || (m_state == RequestBusy)) return; - m_state = RequestIdle; - if (m_manager == ManagerType::Systemd) { - QDBusUnixFileDescriptor dummy; - m_fd.swap(dummy); + m_fd = {}; + m_state = Idle; return; } + m_state = RequestIdle; + const QString method = (m_manager == ManagerType::Gnome) ? u"Uninhibit"_s : u"UnInhibit"_s;