예제 #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)
	}
}
예제 #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)
	}
}
예제 #3
0
파일: xhandle.go 프로젝트: wSCP/scpwm-old
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)
	}
}
예제 #4
0
파일: xhandle.go 프로젝트: wSCP/scpwm-old
func (i *inputFocus) ClearInputFocus() {
	xproto.SetInputFocusChecked(i.conn, xproto.InputFocusPointerRoot, i.root, xproto.TimeCurrentTime)
}