diff --git a/0001-Explicitly-start-osd-if-org.freedesktop.Notification.patch b/0001-Explicitly-start-osd-if-org.freedesktop.Notification.patch new file mode 100644 index 0000000..4ef3c43 --- /dev/null +++ b/0001-Explicitly-start-osd-if-org.freedesktop.Notification.patch @@ -0,0 +1,66 @@ +From 7fe8b63d2c576f57589cd9bfbaf6831baeb28286 Mon Sep 17 00:00:00 2001 +From: Robin Lee +Date: Mon, 20 May 2019 14:57:26 +0800 +Subject: [PATCH] Explicitly start osd if org.freedesktop.Notifications is not + owned + +--- + session.go | 18 +++++++++++++++--- + utils.go | 15 +++++++++++++++ + 2 files changed, 30 insertions(+), 3 deletions(-) + +diff --git a/session.go b/session.go +index 2b610df..ca85df6 100644 +--- a/session.go ++++ b/session.go +@@ -355,9 +355,21 @@ func (m *SessionManager) launchDDE() { + osdRunning, err := isOSDRunning() + if err != nil { + logger.Warning(err) +- } else if osdRunning && globalXSManager.NeedRestartOSD() { +- // restart osd +- m.launch("/usr/lib/deepin-daemon/dde-osd", false) ++ } else { ++ if osdRunning { ++ if globalXSManager.NeedRestartOSD() { ++ logger.Info("Restart dde-osd") ++ m.launch("/usr/lib/deepin-daemon/dde-osd", false) ++ } ++ } else { ++ notificationsOwned, err := isNotificationsOwned() ++ if err != nil { ++ logger.Warning("failed to get org.freedesktop.Notifications status:", err) ++ } else if !notificationsOwned { ++ logger.Info("Explicitly start dde-osd") ++ m.launch("/usr/lib/deepin-daemon/dde-osd", false) ++ } ++ } + } + + groups, err := loadGroupFile() +diff --git a/utils.go b/utils.go +index cc10c25..25c5f35 100644 +--- a/utils.go ++++ b/utils.go +@@ -256,3 +256,18 @@ func isOSDRunning() (bool, error) { + } + return has, nil + } ++ ++func isNotificationsOwned() (bool, error) { ++ sessionBus, err := dbus.SessionBus() ++ if err != nil { ++ return false, err ++ } ++ ++ var has bool ++ err = sessionBus.BusObject().Call("org.freedesktop.DBus.NameHasOwner", 0, ++ "org.freedesktop.Notifications").Store(&has) ++ if err != nil { ++ return false, err ++ } ++ return has, nil ++} +-- +2.21.0 + diff --git a/startdde.spec b/startdde.spec index 4a3def0..5d6c9a4 100644 --- a/startdde.spec +++ b/startdde.spec @@ -1,10 +1,12 @@ Name: startdde Version: 3.12.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Starter of deepin desktop environment License: GPLv3 URL: https://github.com/linuxdeepin/startdde Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# https://bugzilla.redhat.com/show_bug.cgi?id=1711001 +Patch0: 0001-Explicitly-start-osd-if-org.freedesktop.Notification.patch ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} BuildRequires: golang jq @@ -40,6 +42,7 @@ custom applications which compliant with xdg autostart specification. %prep %setup -q +%patch0 -p1 sed -i '/polkit/s|lib|libexec|' watchdog/dde_polkit_agent.go sed -i '/deepin-daemon/s|lib|libexec|' utils.go session.go misc/auto_launch/*.json @@ -76,6 +79,9 @@ BUILD_ID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" %{_datadir}/%{name}/memchecker.json %changelog +* Mon May 20 2019 Robin Lee - 3.12.1-3 +- Add a patch to fix RHBZ#1711001 + * Thu May 16 2019 Robin Lee - 3.12.1-2 - Fix fallback session script path (RHBZ#1706281)