From 8e61ca75a33501bb2a1fa9937b9575fd6b4f20d1 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Thu, 8 Mar 2018 21:51:50 +0100 Subject: [PATCH] Fix iterateWindows on X11 with no param not iterating over root --- wmutil.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wmutil.d b/wmutil.d index e83edbd..adbce21 100644 --- a/wmutil.d +++ b/wmutil.d @@ -73,6 +73,10 @@ struct WindowChildrenIterator { } WindowChildrenIterator iterateWindows(NativeWindowHandle parent = NativeWindowHandle.init) { + static if (UsingSimpledisplayX11) + if (parent == NativeWindowHandle.init) + parent = RootWindow(XDisplayConnection.get, DefaultScreen(XDisplayConnection.get)); + return WindowChildrenIterator(parent); } @@ -153,4 +157,6 @@ unittest { import std.stdio; auto window = findWindowByClass("x-terminal-emulator"); writeln("Terminal: ", window.ownerPID); + foreach (w; iterateWindows) + writeln(w.ownerPID); }