From 8ed29afa68c71e4dd6065f1f501cd283feffcc2e Mon Sep 17 00:00:00 2001 From: zhaoshuang Date: Mon, 13 Sep 2021 19:15:38 +0800 Subject: [PATCH] Add a uniontech patch to fix dm-tool --- 9002-dm-tool-lock-function-patch.patch | 91 ++++++++++++++++++++++++++ lightdm.spec | 6 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 9002-dm-tool-lock-function-patch.patch diff --git a/9002-dm-tool-lock-function-patch.patch b/9002-dm-tool-lock-function-patch.patch new file mode 100644 index 0000000..6046d00 --- /dev/null +++ b/9002-dm-tool-lock-function-patch.patch @@ -0,0 +1,91 @@ +From 60a7f41c675d0c99f697b1e2479feea0e78b9b0f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E6=9B=B9=E5=A8=81?= +Date: Sat, 30 May 2020 14:35:45 +0800 +Subject: [PATCH] dm-tool lock function patch + +--- + src/dm-tool.c | 60 +++++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 51 insertions(+), 9 deletions(-) + +diff --git a/src/dm-tool.c b/src/dm-tool.c +index 5060109..8190aa9 100644 +--- a/src/dm-tool.c ++++ b/src/dm-tool.c +@@ -16,6 +16,41 @@ + #include + #include + ++#define LOCKFRONT_NAME "com.deepin.dde.lockFront" ++ ++static int ++handle_call_lock_front() ++{ ++ g_autoptr(GError) pLockError = NULL; ++ GDBusProxy *pLockFront = g_dbus_proxy_new_for_bus_sync( ++ G_BUS_TYPE_SESSION, ++ G_DBUS_PROXY_FLAGS_NONE, ++ NULL, ++ LOCKFRONT_NAME, ++ "/com/deepin/dde/lockFront", ++ LOCKFRONT_NAME, ++ NULL, ++ &pLockError); ++ if (!pLockFront) ++ { ++ g_printerr("something error happend. %s. %s, %d", LOCKFRONT_NAME, pLockError->message, pLockError->code); ++ return EXIT_FAILURE; ++ } ++ if (!g_dbus_proxy_call_sync( ++ pLockFront, ++ "Show", ++ g_variant_new("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ &pLockError)) ++ { ++ g_printerr("something error happend. %s. %s, %d", LOCKFRONT_NAME, pLockError->message, pLockError->code); ++ return EXIT_FAILURE; ++ } ++ return EXIT_SUCCESS; ++} ++ + static GBusType bus_type = G_BUS_TYPE_SYSTEM; + static GDBusProxy *dm_proxy, *seat_proxy = NULL; + +@@ -259,16 +294,23 @@ main (int argc, char **argv) + return EXIT_FAILURE; + } + +- if (!g_dbus_proxy_call_sync (get_seat_proxy (), +- "Lock", +- g_variant_new ("()"), +- G_DBUS_CALL_FLAGS_NONE, +- -1, +- NULL, +- &error)) ++ if (g_file_test("/etc/deepin-version", G_FILE_TEST_EXISTS)) + { +- g_printerr ("Unable to lock seat: %s\n", error->message); +- return EXIT_FAILURE; ++ return handle_call_lock_front(); ++ } ++ else ++ { ++ if (!g_dbus_proxy_call_sync(get_seat_proxy(), ++ "Lock", ++ g_variant_new("()"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, ++ NULL, ++ &error)) ++ { ++ g_printerr("Unable to lock seat: %s\n", error->message); ++ return EXIT_FAILURE; ++ } + } + return EXIT_SUCCESS; + } +-- +2.20.1 + diff --git a/lightdm.spec b/lightdm.spec index 57036f4..a363ad5 100644 --- a/lightdm.spec +++ b/lightdm.spec @@ -7,7 +7,7 @@ Name: lightdm Summary: A cross-desktop Display Manager Version: 1.30.0 -Release: 7 +Release: 8 # library/bindings are LGPLv2 or LGPLv3, the rest GPLv3+ License: (LGPLv2 or LGPLv3) and GPLv3+ @@ -39,6 +39,7 @@ Patch0: %{giturl}/pull/5.patch#/lightdm-1.25.1-disable_dmrc.patch # UnionTech patchs Patch9001: 9001-multi-pipe-mode.patch +Patch9002: 9002-dm-tool-lock-function-patch.patch BuildRequires: gettext BuildRequires: gnome-common @@ -309,6 +310,9 @@ fi %changelog +* Mon Sep 13 2021 zhaoshuang - 1.30.0-8 +- Add a uniontech patch to fix dm-tool + * Fri Jul 30 2021 zhaoshuang - 1.30.0-7 - Add a uniontech patch to support multi-pipe mode -- Gitee