added Config_monitorDisplayChangeMessages (issue #72)

This commit is contained in:
joten 2016-04-09 16:47:20 +02:00
parent b55bd99ab5
commit 3320f14443
5 changed files with 12 additions and 1 deletions

BIN
bugn.exe

Binary file not shown.

View file

@ -26,6 +26,7 @@ called with the window ID as a paramater, when applying the rule.
11. `+` Added the possibility to minimize windows, making them floating and thereby excluded from tiling. 11. `+` Added the possibility to minimize windows, making them floating and thereby excluded from tiling.
12. `+` Added configuration variables for customizing the date and time format shown in the status bar. 12. `+` Added configuration variables for customizing the date and time format shown in the status bar.
13. `+` Added a function to override the rules applied from `Config.ini` for the active window. 13. `+` Added a function to override the rules applied from `Config.ini` for the active window.
14. `+` Added a configuration variable for customizing the behaviour on display change messages.
| # | `-` or `~` Configuration Variables or <br/> `-` Hotkey Functions | `+` Configuration Variables or <br/> `+` Hotkey Functions | | # | `-` or `~` Configuration Variables or <br/> `-` Hotkey Functions | `+` Configuration Variables or <br/> `+` Hotkey Functions |
| ---:| ---------------------------------------------------------------- | --------------------------------------------------------- | | ---:| ---------------------------------------------------------------- | --------------------------------------------------------- |
@ -88,6 +89,7 @@ called with the window ID as a paramater, when applying the rule.
| 11. | | `#^m::Manager_minimizeWindow()` | | 11. | | `#^m::Manager_minimizeWindow()` |
| 12. | | `Config_readinDateFormat` | | 12. | | `Config_readinDateFormat` |
| | | `Config_readinTimeFormat` | | | | `Config_readinTimeFormat` |
| 14. | | `Config_monitorDisplayChangeMessages` |
### 8.4.0 ### 8.4.0

View file

@ -364,3 +364,8 @@ the data directory of bug.n. Possible values are `off`, `auto` and `ask`.
> The interval in milliseconds, in which the session will be automatically > The interval in milliseconds, in which the session will be automatically
saved to especially support the recovery of window states after bug.n saved to especially support the recovery of window states after bug.n
unintentionally quits. unintentionally quits.
`Config_monitorDisplayChangeMessages=1`
> If true (`=1`) bug.n reacts on `WM_DISPLAYCHANGE` system messages asking to
reset the monitor configuration, e. g. if a monitor is dis-/connected or the
monitor resolution is changed.

View file

@ -103,6 +103,7 @@ Config_init() {
;; Configuration management ;; Configuration management
Config_autoSaveSession := "auto" ;; "off" | "auto" | "ask" Config_autoSaveSession := "auto" ;; "off" | "auto" | "ask"
Config_maintenanceInterval := 5000 Config_maintenanceInterval := 5000
Config_monitorDisplayChangeMessages := True
Config_hotkeyCount := 0 Config_hotkeyCount := 0
Config_restoreConfig(Config_filePath) Config_restoreConfig(Config_filePath)

View file

@ -653,6 +653,8 @@ Manager_override(rule = "") {
} }
Manager_registerShellHook() { Manager_registerShellHook() {
Global Config_monitorDisplayChangeMessages
WM_DISPLAYCHANGE := 126 ;; This message is sent when the display resolution has changed. WM_DISPLAYCHANGE := 126 ;; This message is sent when the display resolution has changed.
Gui, +LastFound Gui, +LastFound
hWnd := WinExist() hWnd := WinExist()
@ -662,6 +664,7 @@ Manager_registerShellHook() {
Debug_logMessage("DEBUG[1] Manager_registerShellHook; hWnd: " . hWnd . ", wndClass: " . wndClass . ", wndTitle: " . wndTitle, 1) Debug_logMessage("DEBUG[1] Manager_registerShellHook; hWnd: " . hWnd . ", wndClass: " . wndClass . ", wndTitle: " . wndTitle, 1)
msgNum := DllCall("RegisterWindowMessage", "Str", "SHELLHOOK") msgNum := DllCall("RegisterWindowMessage", "Str", "SHELLHOOK")
OnMessage(msgNum, "Manager_onShellMessage") OnMessage(msgNum, "Manager_onShellMessage")
If Config_monitorDisplayChangeMessages
OnMessage(WM_DISPLAYCHANGE, "Manager_onDisplayChange") OnMessage(WM_DISPLAYCHANGE, "Manager_onDisplayChange")
} }
;; SKAN: How to Hook on to Shell to receive its messages? (http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323) ;; SKAN: How to Hook on to Shell to receive its messages? (http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323)