Browse Source

fix struts

master
Wesley Kerfoot 4 years ago
parent
commit
00b07ef8b6
  1. 20
      src/nimwin.nim

20
src/nimwin.nim

@ -403,36 +403,34 @@ when isMainModule:
let winAttrs : Option[TXWindowAttributes] = getAttributes(display, ev.xKey.subWindow.addr)
let depth = winAttrs.get.borderWidth.cuint
let borderWidth = winAttrs.get.depth.cuint
let borderWidth = winAttrs.get.borderWidth.cuint
discard XMoveResizeWindow(display,
ev.xKey.subWindow,
0, struts.top.cint,
screenWidth.cuint, screenHeight.cuint - struts.bottom.cuint - borderWidth.cuint)
struts.bottom.cint, struts.top.cint,
screenWidth.cuint, screenHeight.cuint - struts.top.cuint - struts.bottom.cuint)
elif (ev.theType == ButtonPress) and (ev.xButton.subWindow != None):
discard XGetWindowAttributes(display, ev.xButton.subWindow, attr.addr)
start = ev.xButton
elif (ev.theType == MapNotify) and (ev.xmap.overrideRedirect == 0):
elif (ev.theType == MapNotify) and (ev.xmap.override_redirect == 0):
let rootAttrs = getAttributes(display, root.addr)
if rootAttrs.isSome:
let struts = display.calculateStruts
let screenHeight = rootAttrs.get.height
let screenWidth = rootAttrs.get.width
let winAttrs : Option[TXWindowAttributes] = getAttributes(display, ev.xmap.window.addr)
let winAttrs : Option[TXWindowAttributes] = getAttributes(display, ev.xcreatewindow.window.addr)
if winAttrs.isSome and winAttrs.get.overrideRedirect == 0:
if winAttrs.isSome and winAttrs.get.override_redirect == 0:
discard XMoveResizeWindow(display,
ev.xmap.window,
0, struts.top.cint,
screenWidth.cuint, screenHeight.cuint)
struts.bottom.cint, struts.top.cint,
screenWidth.cuint, screenHeight.cuint - struts.top.cuint - struts.bottom.cuint)
discard display.XSetInputFocus(ev.xmap.window, RevertToPointerRoot, CurrentTime)
discard display.XSetInputFocus(ev.xmap.window, RevertToPointerRoot, CurrentTime)
elif (ev.theType == MotionNotify) and (start.subWindow != None):

Loading…
Cancel
Save