Skip to content

Commit

Permalink
GH-280 v2 workaround for when width and height are not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Apr 3, 2024
1 parent 8481a21 commit 680a922
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ahk/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5494,6 +5494,15 @@
if (detect_hw != "") {
DetectHiddenWindows(detect_hw)
}
if (width = "" or height = "") {
WinGetPos(&_, &__, &w, &h, title, text, extitle, extext)
if (width = "") {
width := w
}
if (height = "") {
height := h
}
}
try {
WinMove(x, y, width, height, title, text, extitle, extext)
Expand Down
9 changes: 9 additions & 0 deletions ahk/templates/daemon-v2.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2504,6 +2504,15 @@ AHKWinMove(args*) {
if (detect_hw != "") {
DetectHiddenWindows(detect_hw)
}
if (width = "" or height = "") {
WinGetPos(&_, &__, &w, &h, title, text, extitle, extext)
if (width = "") {
width := w
}
if (height = "") {
height := h
}
}

try {
WinMove(x, y, width, height, title, text, extitle, extext)
Expand Down

0 comments on commit 680a922

Please sign in to comment.