From f9990e10973204b37c96d9264b3f7f5639901fbf Mon Sep 17 00:00:00 2001 From: milarin Date: Mon, 8 Jan 2024 12:50:11 +0100 Subject: [PATCH] remove invalid window handles caused by X11/xwayland --- get_clients.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/get_clients.go b/get_clients.go index d26cd12..f67f756 100644 --- a/get_clients.go +++ b/get_clients.go @@ -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 }