Skip to content

Commit

Permalink
Remove screen resolution changing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejGolian committed Apr 28, 2024
1 parent 801e252 commit 0cf1d43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Remove screen resolution changing as it seems unstable

## [0.4.4] - 2024-04-25

### Added
Expand Down
36 changes: 2 additions & 34 deletions Lib/ReaHotkey.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,9 @@ Class ReaHotkey {

Static CheckResolution() {
If A_ScreenWidth != ReaHotkey.RequiredScreenWidth And A_ScreenHeight != ReaHotkey.RequiredScreenHeight {
ConfirmationDialog := MsgBox("ReaHotkey requires a resolution of " . ReaHotkey.RequiredScreenWidth . " × " . ReaHotkey.RequiredScreenHeight . " in order to run properly.`nTry to change the resolution automatically?", "ReaHotkey", 4)
If ConfirmationDialog == "Yes" {
ReaHotkey.ChangeResolution(ReaHotkey.RequiredScreenWidth, ReaHotkey.RequiredScreenHeight, 32)
If A_ScreenWidth != ReaHotkey.RequiredScreenWidth And A_ScreenHeight != ReaHotkey.RequiredScreenHeight {
MsgBox "Your resolution could not be set to " . ReaHotkey.RequiredScreenWidth . " × " . ReaHotkey.RequiredScreenHeight . ".`nReaHotkey may not operate properly.", "ReaHotkey"
Sleep 500
Return False
}
Else {
MsgBox "Your resolution has been changed successfully.", "ReaHotkey"
Sleep 500
Return True
}
}
MsgBox "Your resolution is not set to " . ReaHotkey.RequiredScreenWidth . " × " . ReaHotkey.RequiredScreenHeight . ".`nReaHotkey may not operate properly.", "ReaHotkey"
Sleep 500
}
Else {
Return True
}
If A_ScreenWidth != ReaHotkey.RequiredScreenWidth And A_ScreenHeight != ReaHotkey.RequiredScreenHeight
MsgBox "Your resolution is not set to " . ReaHotkey.RequiredScreenWidth . " × " . ReaHotkey.RequiredScreenHeight . ".`nReaHotkey may not operate properly.", "ReaHotkey"
Sleep 500
Return False
}

Static FocusNextTab(Overlay) {
Expand Down Expand Up @@ -340,19 +321,6 @@ Class ReaHotkey {
}
}

Class ChangeResolution {
Static Call(ScreenWidth := 1920, ScreenHeight := 1080, ColorDepth := 32) {
DeviceMode := Buffer(156, 0)
NumPut("UShort", 156, DeviceMode, 36)
DllCall("EnumDisplaySettingsA", "UInt",0, "UInt",-1, "Ptr",DeviceMode)
NumPut("UInt", 0x5c0000, DeviceMode, 40)
NumPut("UInt", ColorDepth, DeviceMode, 104)
NumPut("UInt", ScreenWidth, DeviceMode, 108)
NumPut("UInt", ScreenHeight, DeviceMode, 112)
Return DllCall( "ChangeDisplaySettingsA", "Ptr",DeviceMode, "UInt",0 )
}
}

Class HandleError {
Static Call(Exception, Mode) {
ReaHotkey.TurnPluginHotkeysOff()
Expand Down

0 comments on commit 0cf1d43

Please sign in to comment.