From: Ivailo Monev Date: Thu, 28 Apr 2022 06:00:23 +0000 (+0300) Subject: kcontrol: remove check if lid is closed X-Git-Tag: 4.22.0~625 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=90d2eb50e685e6688e71d7b64f716c75f09e0cbf;p=kde%2Fkde-workspace.git kcontrol: remove check if lid is closed since the randr module methods are not D-Bus exported there is (normally) no way for a user to interact with the action and trigger display switch, the system may even be suspended while the lid is closed. there is also the case where the laptop screen is not used (external monitor is used), lid is closed, the system is not suspended and a switch has to happen from the external monitor to the laptop screen because the external monitor is unplugged. the check is just bogus for many cases Signed-off-by: Ivailo Monev --- diff --git a/kcontrol/randr/module/randrmonitor.cpp b/kcontrol/randr/module/randrmonitor.cpp index 5e7fa4f7..086ac45f 100644 --- a/kcontrol/randr/module/randrmonitor.cpp +++ b/kcontrol/randr/module/randrmonitor.cpp @@ -276,19 +276,6 @@ void RandrMonitorModule::checkResumeFromSuspend() void RandrMonitorModule::switchDisplay() { - QDBusMessage call = QDBusMessage::createMethodCall("org.freedesktop.PowerManagement", - "/org/freedesktop/PowerManagement", - "org.freedesktop.PowerManagement", - "isLidClosed"); - QDBusMessage msg = QDBusConnection::sessionBus().call(call); - QDBusReply reply(msg); - - if (reply.isValid() && reply.value()) { - kDebug() << "Lid is closed, ignoring the event"; - //TODO: When we rewrite this, be sure that in this case LVDS is disabled instead of ignoring - return; - } - QList< RandROutput* > outputs; RandRDisplay display; outputs = connectedOutputs( display );