Skip to content

Commit 6649ed7

Browse files
committed
fix: set the default value of statusNotifierHost to true
Issue: linuxdeepin/developer-center#4431 由于dock在daemon检查时可能未启动,导致托盘协议回退。根据 @tsic404 的建议 ,在确定一定会有支持SNI规范的应用(dde-dock)启动的情况下,取消该检查。 Signed-off-by: ComixHe <heyuming@deepin.org>
1 parent 44e230b commit 6649ed7

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

misc/systemd/services/org.dde.session.Daemon1.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ BusName=org.deepin.dde.XEventMonitor1
1717
ExecStart=/usr/lib/deepin-daemon/dde-session-daemon
1818
Slice=app.slice
1919
Restart=on-failure
20+
NotifyAccess=main

trayicon1/status-notifier-watcher.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func newStatusNotifierWatcher(service *dbusutil.Service,
4848
snw := &StatusNotifierWatcher{
4949
service: service,
5050
sigLoop: sigLoop,
51+
IsStatusNotifierHostRegistered: true,
5152
}
5253

5354
sessionBus := service.Conn()
@@ -117,13 +118,11 @@ func (snw *StatusNotifierWatcher) RegisterStatusNotifierHost(serviceName string)
117118
snw.PropsMu.Lock()
118119
defer snw.PropsMu.Unlock()
119120

120-
if snw.IsStatusNotifierHostRegistered {
121+
if snw.hostServiceName != "" {
121122
return dbusutil.ToError(errors.New("host has been registered"))
122123
}
123124

124-
snw.setPropIsStatusNotifierHostRegistered(true)
125125
snw.hostServiceName = serviceName
126-
127126
err := snw.service.Emit(snw, "StatusNotifierHostRegistered")
128127

129128
return dbusutil.ToError(err)
@@ -139,7 +138,6 @@ func (ss *StatusNotifierWatcher) listenDBusNameOwnerChanged() {
139138
if ss.hostServiceName == name {
140139
logger.Infof("host %s lost", name)
141140
ss.hostServiceName = ""
142-
ss.setPropIsStatusNotifierHostRegistered(false)
143141

144142
} else if ss.watchedServices.Contains(name) {
145143
logger.Infof("item %s lost", name)

0 commit comments

Comments
 (0)