From 0cf1d4332f9d3522ac336ca14a7154e163e24f95 Mon Sep 17 00:00:00 2001 From: MatejGolian <11446675+MatejGolian@users.noreply.github.com> Date: Sun, 28 Apr 2024 11:07:44 +0200 Subject: [PATCH] Remove screen resolution changing --- CHANGELOG.md | 4 ++++ Lib/ReaHotkey.ahk | 36 ++---------------------------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fea0f9..3f6a9b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Lib/ReaHotkey.ahk b/Lib/ReaHotkey.ahk index 2891185..052d0ea 100644 --- a/Lib/ReaHotkey.ahk +++ b/Lib/ReaHotkey.ahk @@ -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) { @@ -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()