Beispiel #1
0
// _NET_WM_SYNC_REQUEST req extra
func WmSyncRequestExtra(xu *xgbutil.XUtil, win xproto.Window, reqNum uint64,
	time xproto.Timestamp) error {

	syncReq, err := xprop.Atm(xu, "_NET_WM_SYNC_REQUEST")
	if err != nil {
		return err
	}

	high := int(reqNum >> 32)
	low := int(reqNum<<32 ^ reqNum)

	return ClientEvent(xu, win, "WM_PROTOCOLS", int(syncReq), int(time),
		low, high)
}
Beispiel #2
0
// ClientEvent is a convenience function that sends ClientMessage events
// to the root window as specified by the EWMH spec.
func ClientEvent(xu *xgbutil.XUtil, window xproto.Window, messageType string,
	data ...interface{}) error {

	mstype, err := xprop.Atm(xu, messageType)
	if err != nil {
		return err
	}

	evMask := (xproto.EventMaskSubstructureNotify |
		xproto.EventMaskSubstructureRedirect)
	cm, err := xevent.NewClientMessage(32, window, mstype, data...)
	if err != nil {
		return err
	}

	return xevent.SendRootEvent(xu, cm, uint32(evMask))
}
Beispiel #3
0
// _NET_WM_PING req extra
func WmPingExtra(xu *xgbutil.XUtil, win xproto.Window, response bool,
	time xproto.Timestamp) error {

	pingAtom, err := xprop.Atm(xu, "_NET_WM_PING")
	if err != nil {
		return err
	}

	var evWindow xproto.Window
	if response {
		evWindow = xu.RootWin()
	} else {
		evWindow = win
	}

	return ClientEvent(xu, evWindow, "WM_PROTOCOLS", int(pingAtom), int(time),
		int(win))
}