mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
update linux active pid consistent with other platforms
This commit is contained in:
parent
f0c84a23d3
commit
89c3d91e92
@ -43,7 +43,8 @@ func ActivePIDC(pid int32, args ...int) {
|
||||
}
|
||||
|
||||
// ActivePID makes the window of the PID the active window
|
||||
func ActivePID(pid int32) error {
|
||||
// If args[0] > 0 on the unix platform via a xid to active
|
||||
func ActivePID(pid int32, args ...int) error {
|
||||
if xu == nil {
|
||||
var err error
|
||||
xu, err = xgbutil.NewConn()
|
||||
@ -52,6 +53,15 @@ func ActivePID(pid int32) error {
|
||||
}
|
||||
}
|
||||
|
||||
if len(args) > 0 {
|
||||
err := ewmh.ActiveWindowReq(xu, xproto.Window(pid))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
xid, err := getXidFromPid(xu, pid)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user