|
@ -46,7 +46,10 @@ iterator getChildren(display : PDisplay) : Window = |
|
|
if display.XGetWindowAttributes(currentWindow[], attr.addr) == BadWindow: |
|
|
if display.XGetWindowAttributes(currentWindow[], attr.addr) == BadWindow: |
|
|
continue |
|
|
continue |
|
|
|
|
|
|
|
|
yield Window( |
|
|
if attr.map_state != IsViewable: |
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
let win = Window( |
|
|
x: attr.x.cint, |
|
|
x: attr.x.cint, |
|
|
y: attr.y.cint, |
|
|
y: attr.y.cint, |
|
|
width: attr.width, |
|
|
width: attr.width, |
|
@ -55,6 +58,8 @@ iterator getChildren(display : PDisplay) : Window = |
|
|
screen: attr.screen |
|
|
screen: attr.screen |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
yield win |
|
|
|
|
|
|
|
|
discard XFree(childrenReturn) |
|
|
discard XFree(childrenReturn) |
|
|
|
|
|
|
|
|
proc getDisplay : PDisplay = |
|
|
proc getDisplay : PDisplay = |
|
@ -178,7 +183,6 @@ when isMainModule: |
|
|
#discard display.XFlush() |
|
|
#discard display.XFlush() |
|
|
|
|
|
|
|
|
let windowStack = toSeq(getChildren(display)) |
|
|
let windowStack = toSeq(getChildren(display)) |
|
|
echo windowStack.len |
|
|
|
|
|
|
|
|
|
|
|
discard display.XSetInputFocus(windowStack[0].win, RevertToPointerRoot, CurrentTime) |
|
|
discard display.XSetInputFocus(windowStack[0].win, RevertToPointerRoot, CurrentTime) |
|
|
discard display.XRaiseWindow(windowStack[0].win) |
|
|
discard display.XRaiseWindow(windowStack[0].win) |
|
|