From 4b268db62722c63fd73d04c4cd6ba0affe735627 Mon Sep 17 00:00:00 2001 From: Matt George Date: Fri, 14 Apr 2023 09:07:46 -0400 Subject: [PATCH] avoid crash when WM_CLASS has gone awol --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index c1a8f18..d12239f 100644 --- a/client.go +++ b/client.go @@ -116,7 +116,7 @@ func (c Client) Restore() { c.MoveResize(geom.X(), geom.Y(), geom.Width(), geom.Height()) } -// Activate makes the client the currently active window +// Activate makes the client the currently active window func (c Client) Activate() { ewmh.ActiveWindowReq(state.X, c.window.Id) } @@ -148,6 +148,7 @@ func shouldIgnore(w xproto.Window) bool { c, err := icccm.WmClassGet(state.X, w) if err != nil { log.Warn(err) + return true // c is nil and can't be used below } for _, s := range Config.WindowsToIgnore {