code: func SmartGrab(xu *xgbutil.XUtil, win xproto.Window) error {
  	err := GrabKeyboard(xu, win)
  	if err != nil {
  		return fmt.Errorf("SmartGrab: %s", err)
  	}
  
  	// Now redirect all key events to the dummy window to prevent races
  	xevent.RedirectKeyEvents(xu, win)
  
  	return nil
  }
docs: // SmartGrab grabs the keyboard for the given window, and redirects all
  // key events in the xevent main event loop to avoid races.