Fix iterateWindows on X11 with no param not iterating over root

This commit is contained in:
WebFreak001 2018-03-08 21:51:50 +01:00
parent 652b30151f
commit 8e61ca75a3
1 changed files with 6 additions and 0 deletions

View File

@ -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);
}