Example #1
0
// FocusParent is just like Focus, except it sets the "revert-to" mode to
// Parent. This should be used when setting focus to a sub-window.
func (w *Window) FocusParent(tstamp xproto.Timestamp) {
	mode := byte(xproto.InputFocusParent)
	err := xproto.SetInputFocusChecked(w.X.Conn(), mode, w.Id, tstamp).Check()
	if err != nil {
		xgbutil.Logger.Println(err)
	}
}
Example #2
0
// Focus tries to issue a SetInputFocus to get the focus.
// If you're trying to change the top-level active window, please use
// ewmh.ActiveWindowReq instead.
func (w *Window) Focus() {
	mode := byte(xproto.InputFocusPointerRoot)
	err := xproto.SetInputFocusChecked(w.X.Conn(), mode, w.Id, 0).Check()
	if err != nil {
		xgbutil.Logger.Println(err)
	}
}
Example #3
0
func (i *inputFocus) SetInputFocus(c *Client) {
	if c == nil {
		i.ClearInputFocus()
	} else {
		if c.icccmFocus {
			//send_client_message(n->client->window, ewmh->WM_PROTOCOLS, WM_TAKE_FOCUS)
		}
		xproto.SetInputFocusChecked(i.conn, xproto.InputFocusPointerRoot, c.Window.Window, xproto.TimeCurrentTime)
	}
}
Example #4
0
func (i *inputFocus) ClearInputFocus() {
	xproto.SetInputFocusChecked(i.conn, xproto.InputFocusPointerRoot, i.root, xproto.TimeCurrentTime)
}