diff options
Diffstat (limited to 'src/windowmanager.nim')
-rw-r--r-- | src/windowmanager.nim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/windowmanager.nim b/src/windowmanager.nim index 2eb947e..c67223b 100644 --- a/src/windowmanager.nim +++ b/src/windowmanager.nim @@ -53,7 +53,7 @@ proc createWindowManager*: WindowManager = root: display.DefaultRootWindow(), clients: @[], - focused: 0, + focused: -1, keys: initTable[cuint, objects.Key](1)) # Run window manager @@ -175,10 +175,8 @@ proc onXError (display: PDisplay, e: PXErrorEvent): cint{.cdecl.} = " request: " & $e.request_code & "\n" & " error code: " & $e.error_code & " - " & errorText & "\n" & " resource id: " & $e.resourceid) - return 0 - proc addWindow (wm: WindowManager, w: Window) = wm.clients.add w discard wm.display.XSetInputFocus(w, RevertToParent, CurrentTime) @@ -234,8 +232,8 @@ proc onUnmapNotify (wm: WindowManager, e: PXUnmapEvent) = if wm.focused > -1: discard wm.display.XSetInputFocus(wm.clients[wm.focused], RevertToParent, CurrentTime) - let index = wm.clients.find(e.window) - if index > -1: wm.clients.delete index + let ti = wm.clients.find(e.window) + if ti > -1: wm.clients.delete ti wm.tileWindows() proc onConfigureNotify (wm: WindowManager, e: PXConfigureEvent) = return |