示例#1
0
文件: layout.go 项目: pascience/foci
func (c *Client) CheckNewWorkspace() {
	var newWrk *workspace.Workspace = nil
	curWrk := c.Workspace()

	if dragGeom := c.DragGeom(); dragGeom != nil {
		newWrk = wm.Heads.FindMostOverlap(dragGeom)
	} else {
		newWrk = wm.Heads.FindMostOverlap(c.frame.Geom())
	}
	if newWrk == nil || curWrk == newWrk {
		return
	}

	newWrk.Add(c)

	// If this is the active window, switch to this workspace too.
	if c.IsActive() {
		wm.SetWorkspace(newWrk, false)
	}
}