summaryrefslogtreecommitdiff
path: root/src/windowmanager.nim
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2020-08-10 20:52:16 -0700
committerkitty piapiac <kcp@bsd.computer>2020-08-10 20:52:16 -0700
commit0f7e320fa198ffebaaea98d142eabee25d8fdafb (patch)
tree6e85ea65c110fb8e0de88cd0b13521814d5d987e /src/windowmanager.nim
parent92baae67185f19c71c99134a06d5d42a43e83703 (diff)
(/・・)ノ better default config
Diffstat (limited to 'src/windowmanager.nim')
-rw-r--r--src/windowmanager.nim8
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