示例#1
0
文件: command.go 项目: dlintw/wingo
func cmdFocus(args ...string) func() {
	return func() {
		withFocusedOrArg(args, func(c *client) {
			focus.Focus(c)
		})
	}
}
示例#2
0
func (c *client) CycleSelected() {
	if c.iconified {
		c.workspace.IconifyToggle(c)
	}
	focus.Focus(c)
	stack.Raise(c)
}
示例#3
0
func (mcmd mouseCommand) commandFun() func(c *client) {
	tryShellFun := commandShellFun(mcmd.cmd)
	if tryShellFun != nil {
		return func(c *client) {
			tryShellFun()
			xevent.ReplayPointer(X)
		}
	}

	switch mcmd.cmd {
	case "FocusRaise":
		return func(c *client) {
			focus.Focus(c)
			stack.Raise(c)
			xevent.ReplayPointer(X)
		}
	case "Focus":
		return func(c *client) {
			focus.Focus(c)
			xevent.ReplayPointer(X)
		}
	case "Raise":
		return func(c *client) {
			stack.Raise(c)
			xevent.ReplayPointer(X)
		}
	case "Close":
		return func(c *client) {
			c.Close()
		}
	case "MaximizeToggle":
		return func(c *client) {
			// c.MaximizeToggle()
		}
	case "Minimize":
		return func(c *client) {
			c.workspace.IconifyToggle(c)
		}
	}

	logger.Warning.Printf("Undefined mouse command: '%s'", mcmd.cmd)

	return nil
}
示例#4
0
文件: state.go 项目: dlintw/wingo
func (wingo *wingoState) focusFallback() {
	wrk := wingo.workspace()
	for i := len(focus.Clients) - 1; i >= 0; i-- {
		switch client := focus.Clients[i].(type) {
		case *client:
			if client.frame.IsMapped() && client.workspace == wrk {
				focus.Focus(client)
				return
			}
		default:
			fmt.Printf("Unsupported client type: %T", client)
			panic("Not implemented.")
		}
	}
	focus.Root()
}
示例#5
0
func newClient(X *xgbutil.XUtil, id xproto.Window) *client {
	X.Grab()
	defer X.Ungrab()

	if client := wingo.findManagedClient(id); client != nil {
		logger.Message.Printf("Already managing client: %s", client)
		return nil
	}

	win := xwindow.New(X, id)
	if _, err := win.Geometry(); err != nil {
		logger.Warning.Printf("Could not manage client %d because: %s", id, err)
		return nil
	}

	c := &client{
		X:           X,
		win:         win,
		name:        "N/A",
		state:       frame.Inactive,
		layer:       stack.LayerDefault,
		maximized:   false,
		iconified:   false,
		unmapIgnore: 0,
		floating:    false,
	}

	c.manage()
	if !c.iconified {
		c.Map()
		if c.primaryType == clientTypeNormal {
			focus.Focus(c)
		}
	}
	return c
}
示例#6
0
func (c *client) SelectSelected() {
	focus.Focus(c)
	stack.Raise(c)
}
示例#7
0
func (c *Client) Focus() {
	c.attnStop()
	focus.Focus(c)
}
示例#8
0
文件: focus.go 项目: yannicklm/wingo
func (c *Client) Focus() {
	focus.Focus(c)
}