Skip to content

Commit

Permalink
Simplified the PositionWindow logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMessinger committed May 23, 2021
1 parent 9073fdf commit fc24071
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/util/windows.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,17 @@ PositionWindow(Window, ID, Left, Top, Width, Height)

If (IsVerticalMonitor and IsTouchingBottom and IsTouchingRight)
{
; These apps aren't affected by the bug. So no correction is necessary
NoCorrectionNecessary := WindowMatches(Window, { Title: ["Google Chrome", "Sourcetree"] })
or WindowMatches(Window, { Process: "Spotify.exe", HasTitle: True })
or WindowMatches(Window, { Process: "Slack.exe" })
; These apps need their height reduced by 612 pixels
Subtract612 := WindowMatches(Window, { Title: ["XXXXX", "YYYYY", "ZZZZZ"] })

If (!NoCorrectionNecessary)
{
; These apps need their height reduced by 472 pixels
Subtract472 := WindowMatches(Window, { Title: "GitKraken" })

If (Subtract472)
HeightAdjustment := -472
Else
; All other apps need their height reduced by 612 pixels
HeightAdjustment := -612
}
; These apps need their height reduced by 472 pixels
Subtract472 := WindowMatches(Window, { Process: "Explorer.EXE", Class: "CabinetWClass" })
Or WindowMatches(Window, { Title: ["GitKraken", "XXXXX", "YYYYY"] })

If (Subtract612)
HeightAdjustment := -612
Else If (Subtract472)
HeightAdjustment := -472
}

If (HeightAdjustment != 0)
Expand Down

0 comments on commit fc24071

Please sign in to comment.