func Lock(X *xgb.Conn) error {
	screen := xproto.Setup(X).DefaultScreen(X)

	passEventsToOwner := false
	kbCookie := xproto.GrabKeyboard(X, passEventsToOwner, screen.Root, xproto.TimeCurrentTime, xproto.GrabModeAsync, xproto.GrabModeAsync)
	kbReply, err := kbCookie.Reply()
	if err != nil {
		return err
	}
	if kbReply.Status != xproto.GrabStatusSuccess {
		return fmt.Errorf("GrabKeyboard status %v", grabStatus(kbReply.Status))
	}

	ptrCookie := xproto.GrabPointer(X, passEventsToOwner, screen.Root, 0, xproto.GrabModeAsync, xproto.GrabModeAsync, xproto.AtomNone, xproto.AtomNone, xproto.TimeCurrentTime)

	ptrReply, err := ptrCookie.Reply()
	if err != nil {
		xproto.UngrabKeyboard(X, xproto.TimeCurrentTime)
		return err
	}
	if ptrReply.Status != xproto.GrabStatusSuccess {
		return fmt.Errorf("GrabPointer status %v", grabStatus(kbReply.Status))
	}

	return nil
}
// Lock grabs the keyboard and pointer locking the X11 display
Lock grabs the keyboard and pointer locking the X11 display
// Lock grabs the keyboard and pointer locking the X11 display
func Lock(X *xgb.Conn) error {
	screen := xproto.Setup(X).DefaultScreen(X)
	passEventsToOwner := false
	kbCookie := xproto.GrabKeyboard(X, passEventsToOwner, screen.Root, xproto.TimeCurrentTime, xproto.GrabModeAsync, xproto.GrabModeAsync)
	kbReply, err := kbCookie.Reply()
	if err != nil {
		return err
	}
	if kbReply.Status != xproto.GrabStatusSuccess {
		return fmt.Errorf("GrabKeyboard status %v", grabStatus(kbReply.Status))
	}
	ptrCookie := xproto.GrabPointer(X, passEventsToOwner, screen.Root, 0, xproto.GrabModeAsync, xproto.GrabModeAsync, xproto.AtomNone, xproto.AtomNone, xproto.TimeCurrentTime)
	ptrReply, err := ptrCookie.Reply()
	if err != nil {
		xproto.UngrabKeyboard(X, xproto.TimeCurrentTime)
		return err
	}
	if ptrReply.Status != xproto.GrabStatusSuccess {
		return fmt.Errorf("GrabPointer status %v", grabStatus(kbReply.Status))
	}
	return nil
}
func Lock ( X * xgb . Conn ) error { screen := xproto . Setup ( X ) . DefaultScreen ( X ) passEventsToOwner := false kbCookie := xproto . GrabKeyboard ( X , passEventsToOwner , screen . Root , xproto . TimeCurrentTime , xproto . GrabModeAsync , xproto . GrabModeAsync ) kbReply , err := kbCookie . Reply ( ) if err != nil { return err } if kbReply . Status != xproto . GrabStatusSuccess { return fmt . Errorf ( " " , grabStatus ( kbReply . Status ) ) } ptrCookie := xproto . GrabPointer ( X , passEventsToOwner , screen . Root , 0 , xproto . GrabModeAsync , xproto . GrabModeAsync , xproto . AtomNone , xproto . AtomNone , xproto . TimeCurrentTime ) ptrReply , err := ptrCookie . Reply ( ) if err != nil { xproto . UngrabKeyboard ( X , xproto . TimeCurrentTime ) return err } if ptrReply . Status != xproto . GrabStatusSuccess { return fmt . Errorf ( " " , grabStatus ( kbReply . Status ) ) } return nil }
Lock grabs the keyboard and pointer locking the X11 display
Lock grabs the keyboard and pointer locking the X11 display