From 06a5dfbf0117169b179d46aca05632779cc603d7 Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Wed, 17 Apr 2024 20:28:58 +0800 Subject: [PATCH 16/16] fix(display): Fix handling Dbus method calls returning twice causing crashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复处理Dbus方法调用返回两次导致崩溃 #35488 --- plugins/display/display-monitor.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/display/display-monitor.cpp b/plugins/display/display-monitor.cpp index 49f23ff..5402c5d 100644 --- a/plugins/display/display-monitor.cpp +++ b/plugins/display/display-monitor.cpp @@ -1,14 +1,14 @@ /** - * Copyright (c) 2020 ~ 2021 KylinSec Co., Ltd. + * Copyright (c) 2020 ~ 2021 KylinSec Co., Ltd. * kiran-cc-daemon is licensed under Mulan PSL v2. - * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. * You may obtain a copy of Mulan PSL v2 at: - * http://license.coscl.org.cn/MulanPSL2 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v2 for more details. - * + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + * * Author: tangjie02 */ @@ -200,6 +200,7 @@ void DisplayMonitor::Enable(bool enabled, MethodInvocation &invocation) if (enabled == this->enabled_get()) { invocation.ret(); + return; } // 如果状态发生了变化而且是关闭最后一个开启的显示器,则禁止该操作(至少保证有一个显示器时开启的) -- 2.33.0