Exemplo n.º 1
0
func cmdFocus(args ...string) func() {
	return func() {
		withFocusedOrArg(args, func(c *client) {
			focus.Focus(c)
		})
	}
}
Exemplo n.º 2
0
func (c *client) CycleSelected() {
	if c.iconified {
		c.workspace.IconifyToggle(c)
	}
	focus.Focus(c)
	stack.Raise(c)
}
Exemplo n.º 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
}
Exemplo n.º 4
0
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()
}
Exemplo n.º 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
}
Exemplo n.º 6
0
func (c *client) SelectSelected() {
	focus.Focus(c)
	stack.Raise(c)
}
Exemplo n.º 7
0
func (c *Client) Focus() {
	c.attnStop()
	focus.Focus(c)
}
Exemplo n.º 8
0
func (c *Client) Focus() {
	focus.Focus(c)
}