Browse Source

use both partial and regular struts properties when calculating struts

fix-resizing
Wesley Kerfoot 4 years ago
parent
commit
e1d6171bb8
  1. 4
      src/nimwin.nim

4
src/nimwin.nim

@ -262,7 +262,7 @@ processChan.open(0)
proc startTerminal() : Process = proc startTerminal() : Process =
let terminal_path = getEnv("NIMWIN_TERMINAL", "/usr/bin/urxvt") let terminal_path = getEnv("NIMWIN_TERMINAL", "/usr/bin/urxvt")
startProcess(terminal_path) startProcess(terminal_path, "", ["-e", "tmux"])
proc launcher() : Process = proc launcher() : Process =
let launcher_path = getEnv("NIMWIN_LAUNCHER", "/usr/bin/dmenu_run") let launcher_path = getEnv("NIMWIN_LAUNCHER", "/usr/bin/dmenu_run")
@ -276,7 +276,7 @@ proc handleProcess(p : Process) =
proc calculateStruts(display : PDisplay) : tuple[top: uint, bottom: uint]= proc calculateStruts(display : PDisplay) : tuple[top: uint, bottom: uint]=
for win in getChildren(display): for win in getChildren(display):
for prop in win.props: for prop in win.props:
if prop.kind == pkCardinal and prop.name == "_NET_WM_STRUT_PARTIAL": if prop.kind == pkCardinal and prop.name.startsWith("_NET_WM_STRUT"):
result.top = max(result.top, prop.cardinalProp[2]) result.top = max(result.top, prop.cardinalProp[2])
result.bottom = max(result.bottom, prop.cardinalProp[3]) result.bottom = max(result.bottom, prop.cardinalProp[3])

Loading…
Cancel
Save