Skip to content

Commit

Permalink
feat: TreeLand display service special handlle
Browse files Browse the repository at this point in the history
TreeLand模式下,部分模块不启动(后续适配完成,恢复)

Log:
  • Loading branch information
echengqi authored and justforlxz committed Aug 8, 2024
1 parent 18a92c8 commit e16a0b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/dde-session-daemon/main.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -154,6 +157,7 @@ func init() {

// -disable
flag.StringVar(&_options.disable, "disable", "", "Disable modules, ignore settings.")

}

func main() {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit e16a0b5

Please sign in to comment.