From e16a0b5968c3b13f69c90b38e3f9616f24674318 Mon Sep 17 00:00:00 2001 From: echengqi Date: Thu, 8 Aug 2024 09:42:46 +0800 Subject: [PATCH] feat: TreeLand display service special handlle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TreeLand模式下,部分模块不启动(后续适配完成,恢复) Log: --- bin/dde-session-daemon/main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) mode change 100644 => 100755 bin/dde-session-daemon/main.go diff --git a/bin/dde-session-daemon/main.go b/bin/dde-session-daemon/main.go old mode 100644 new mode 100755 index 838825e70..fbb3df42d --- a/bin/dde-session-daemon/main.go +++ b/bin/dde-session-daemon/main.go @@ -43,6 +43,9 @@ import ( var logger = log.NewLogger("daemon/dde-session-daemon") var hasDDECookie bool +var hasTreeLand bool + +var treeLandNotAllowModules = []string{"x-event-monitor", "keybinding", "trayicon", "screensaver", "inputdevices", "power"} func isInShutdown() bool { bus, err := dbus.SystemBus() @@ -154,6 +157,7 @@ func init() { // -disable flag.StringVar(&_options.disable, "disable", "", "Disable modules, ignore settings.") + } func main() { @@ -190,6 +194,12 @@ func main() { _options.disableModules = strings.Split(_options.disable, ",") } + if os.Getenv("DDE_CURRENT_COMPOSITOR") == "TreeLand" { + hasTreeLand = true + } + + logger.Infof("env DDE_CURRENT_COMPOSITOR is %s", os.Getenv("DDE_CURRENT_COMPOSITOR")) + usr, err := user.Current() if err == nil { _ = os.Chdir(usr.HomeDir) @@ -236,6 +246,8 @@ func main() { err = app.enableModules(_options.enablingModules) } else if len(_options.disableModules) > 0 { err = app.disableModules(_options.disableModules) + } else if hasTreeLand { + err = app.disableModules(treeLandNotAllowModules) } else { app.execDefaultAction() }