diff --git a/src/Manager.ahk b/src/Manager.ahk index b70ec9b..7f992d3 100644 --- a/src/Manager.ahk +++ b/src/Manager.ahk @@ -110,7 +110,7 @@ Manager_applyRules(wndId, ByRef isManaged, ByRef m, ByRef tags, ByRef isFloating WinGetClass, wndClass, ahk_id %wndId% WinGetTitle, wndTitle, ahk_id %wndId% WinGetPos, wndX, wndY, wndWidth, wndHeight, ahk_id %wndId% - If (wndClass Or wndTitle) And Not (wndX < -4999) And Not (wndY < -4999) { + If (wndClass Or wndTitle) { Loop, % Config_ruleCount { ;; The rules are traversed in reverse order. i := Config_ruleCount - A_Index + 1 @@ -381,9 +381,6 @@ Manager_manage(preferredMonitor, preferredView, wndId) tags := 1 << (preferredView - 1) } - If Window_isElevated(wndId) - isManaged := 0 - a := Manager__setWinProperties( wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action) ; Do view placement. diff --git a/src/Window.ahk b/src/Window.ahk index beb21c0..7a4d47f 100644 --- a/src/Window.ahk +++ b/src/Window.ahk @@ -110,6 +110,18 @@ Window_isHung(wndId) { Return, 0 } +Window_isNotVisible(wndId) { + WS_VISIBLE = 0x10000000 + WinGet, wndStyle, Style, ahk_id %wndId% + If (wndStyle & WS_VISIBLE) { + WinGetPos, wndX, wndY, wndW, wndH, ahk_id %wndId% + hasDimensions := wndW And wndH + isOnMonitor := Monitor_get(wndX + 5, wndY + 5) Or Monitor_get(wndX + wndW - 5, wndY + 5) Or Monitor_get(wndX + wndW, wndY + wndH - 5) Or Monitor_get(wndX + 5, wndY + wndH - 5) + Return, (Not hasDimensions Or Not isOnMonitor) + } Else + Return, True +} + Window_isPopup(wndId) { WS_POPUP = 0x80000000 WinGet, wndStyle, Style, ahk_id %wndId%