From 7c42a04d66df733594283c440a3025c6c8f3071f Mon Sep 17 00:00:00 2001 From: kitty piapiac Date: Wed, 29 Jul 2020 08:41:41 -0700 Subject: =?UTF-8?q?(/=E3=83=BB=E3=83=BB)=E3=83=8E=20small=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit map the window --- src/windowmanager.nim | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/windowmanager.nim') diff --git a/src/windowmanager.nim b/src/windowmanager.nim index 18fede3..df00b6c 100644 --- a/src/windowmanager.nim +++ b/src/windowmanager.nim @@ -92,7 +92,7 @@ proc run* (wm: WindowManager) = of MotionNotify: wm.onMotionNotify addr e.xmotion of KeyPress: wm.onKeyPress addr e.xkey of KeyRelease: wm.onKeyRelease addr e.xkey - else: lvlWarn.log("ignored event") + else: lvlWarn.log("ignored event " & $e.theType) # Initialization Stuff proc initKeybindings (wm: WindowManager) = @@ -105,7 +105,6 @@ proc initKeybindings (wm: WindowManager) = keyfunc = wm.procFromFunc key.keyfunc wm.keyhandlers[cuint keycode] = keyfunc - echo typeof wm.keyhandlers[cuint keycode] discard wm.display.XGrabKey( cint keycode, @@ -175,10 +174,12 @@ proc onReparentNotify (wm: WindowManager, e: PXReparentEvent) = return proc onMapNotify (wm: WindowManager, e: PXMapEvent) = return proc onUnmapNotify (wm: WindowManager, e: PXUnmapEvent) = return proc onConfigureNotify (wm: WindowManager, e: PXConfigureEvent) = return -proc onMapRequest (wm: WindowManager, e: PXMapRequestEvent) = return -proc onConfigureRequest (wm: WindowManager, e: PXConfigureRequestEvent) = - var changes: PXWindowChanges +proc onMapRequest (wm: WindowManager, e: PXMapRequestEvent) = + discard wm.display.XMapWindow(e.window) + +proc onConfigureRequest (wm: WindowManager, e: PXConfigureRequestEvent) = + var changes: XWindowChanges changes.x = e.x changes.y = e.y @@ -188,7 +189,7 @@ proc onConfigureRequest (wm: WindowManager, e: PXConfigureRequestEvent) = changes.sibling = e.above changes.stack_mode = e.detail - discard wm.display.XConfigureWindow(e.window, cuint e.value_mask, changes) + discard wm.display.XConfigureWindow(e.window, cuint e.value_mask, addr changes) proc onButtonPress (wm: WindowManager, e: PXButtonEvent) = return proc onButtonRelease (wm: WindowManager, e: PXButtonEvent) = return -- cgit v1.2.3