remove invalid window handles caused by X11/xwayland

This commit is contained in:
milarin 2024-01-08 12:50:11 +01:00 committed by Milarin
parent b779e88150
commit f9990e1097

View File

@ -3,6 +3,8 @@ package hypr
import (
"encoding/json"
"os/exec"
"git.milar.in/milarin/slices"
)
func GetWindows() ([]*Window, error) {
@ -26,5 +28,9 @@ func GetWindows() ([]*Window, error) {
return nil, err
}
windows = slices.Filter(windows, func(w *Window) bool {
return w.PID != -1
})
return windows, nil
}