diff --git a/doc/CHANGES.md b/doc/CHANGES.md
index d915866..079987b 100644
--- a/doc/CHANGES.md
+++ b/doc/CHANGES.md
@@ -25,6 +25,7 @@ called with the window ID as a paramater, when applying the rule.
10. `~` Removed the function `Main_reload` and reassigned the hotkey.
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.
+13. `+` Added a function to force the active window to be managed despite any rule in `Config.ini`.
| # | `-` or `~` Configuration Variables or
`-` Hotkey Functions | `+` Configuration Variables or
`+` Hotkey Functions |
| ---:| ---------------------------------------------------------------- | --------------------------------------------------------- |
@@ -87,6 +88,7 @@ called with the window ID as a paramater, when applying the rule.
| 11. | | `#^m::Manager_minimizeWindow()` |
| 12. | | `Config_readinDateFormat` |
| | | `Config_readinTimeFormat` |
+| 13. | | `#^+m::Manager_forceManaged()` |
### 8.4.0
diff --git a/doc/Cheat_sheet/Default_hotkeys.md b/doc/Cheat_sheet/Default_hotkeys.md
index b0e5e0f..8ab3dca 100644
--- a/doc/Cheat_sheet/Default_hotkeys.md
+++ b/doc/Cheat_sheet/Default_hotkeys.md
@@ -32,6 +32,9 @@ _Minimize_ the active window.
#### WinShiftm
_Move_ the active window _by key_.
+#### WinCtrlShiftm
+_Force_ the active window to be _managed_.
+
#### WinShifts
_Resize_ the active window _by key_.
@@ -84,7 +87,7 @@ Increment the debug log level.
### Layout management
#### WinTab
-Set the _previous_ly set _layout_.
+Set the _previous_-ly set _layout_.
#### Winf
Set the _floating layout_.
diff --git a/doc/Cheat_sheet/cheat_sheet.html b/doc/Cheat_sheet/cheat_sheet.html
index d3ffb3a..d70979a 100644
--- a/doc/Cheat_sheet/cheat_sheet.html
+++ b/doc/Cheat_sheet/cheat_sheet.html
@@ -54,6 +54,10 @@
WinShifts
Resize the active window by key.
@@ -122,7 +126,7 @@
Layout management
WinTab
-
Set the previously set layout.
+
Set the previous-ly set layout.
Winf
diff --git a/doc/Cheat_sheet/cheat_sheet.pdf b/doc/Cheat_sheet/cheat_sheet.pdf
index 7e1639b..99aa12f 100644
Binary files a/doc/Cheat_sheet/cheat_sheet.pdf and b/doc/Cheat_sheet/cheat_sheet.pdf differ
diff --git a/doc/Default_hotkeys.md b/doc/Default_hotkeys.md
index 23a2eba..e0a931a 100644
--- a/doc/Default_hotkeys.md
+++ b/doc/Default_hotkeys.md
@@ -59,6 +59,19 @@ This implicitly sets the window to be floating.
This implicitly sets the window to be floating.
+`Config_hotkey=#^+m::Manager_forceManaged()`
+> _Force_ the active window to be _managed_.
+
+This function is EXPERIMENTAL, which does not mean that it is in an
+alpha-development stage, but you should know what you do, if using this hotkey.
+
+It forces the flag "is managed" to be true (1) despite any rule in
+`Config.ini`. If set improperly, a window, which is not a regular application
+window, may only be reset by logging out from and back in to Windows.
+
+You may also want to use `#+f::View_toggleFloatingWindow()` to see the full
+effect.
+
`Config_hotkey=#+s::Manager_sizeWindow()`
> _Resize_ the active window _by key_.
@@ -151,7 +164,7 @@ level to an absolute value by using the first parameter.
### Layout management
`Config_hotkey=#Tab::View_setLayout(-1)`
-> Set the _previous_ly set _layout_.
+> Set the _previous_-ly set _layout_.
You may also use `View_setLayout(0, +1)` for setting the next or
`View_setLayout(0, -1)` for setting the previous layout in the layout array.
diff --git a/doc/Used_hotkeys.md b/doc/Used_hotkeys.md
index 5b7b346..eaaea57 100644
--- a/doc/Used_hotkeys.md
+++ b/doc/Used_hotkeys.md
@@ -31,7 +31,7 @@ There are not many special character keys, which are on both keyboards, US and D
| f | x | x | | | | |
| h | | | x | | | |
| i | x | x | x | x | | |
-| m | x | x | x | | | |
+| m | x | x | x | x | | |
| n | | x | | | | |
| q | | | x | | | |
| r | | | x | | | |
diff --git a/src/Config.ahk b/src/Config.ahk
index 69cf859..bd381c0 100644
--- a/src/Config.ahk
+++ b/src/Config.ahk
@@ -406,6 +406,7 @@ Config_UI_saveSession() {
#+f::View_toggleFloatingWindow()
#+m::Manager_moveWindow()
#^m::Manager_minimizeWindow()
+#^+m::Manager_forceManaged()
#+s::Manager_sizeWindow()
#+x::Manager_maximizeWindow()
#i::Manager_getWindowInfo()
diff --git a/src/Manager.ahk b/src/Manager.ahk
index 62b6c9d..4609fda 100644
--- a/src/Manager.ahk
+++ b/src/Manager.ahk
@@ -191,6 +191,16 @@ Manager_doMaintenance:
Manager_saveState()
Return
+Manager_forceManaged() {
+ Local aWndId
+
+ WinGet, aWndId, ID, A
+ Manager_manage(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1, aWndId, True)
+ If Config_dynamicTiling
+ View_arrange(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
+ Bar_updateView(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
+}
+
Manager_getWindowInfo()
{
Local aWndClass, aWndHeight, aWndId, aWndMinMax, aWndPId, aWndPName, aWndStyle, aWndTitle, aWndWidth, aWndX, aWndY, rule, text, v
@@ -319,22 +329,19 @@ Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hi
;; Accept a window to be added to the system for management.
;; Provide a monitor and view preference, but don't override the config.
-Manager_manage(preferredMonitor, preferredView, wndId)
-{
+Manager_manage(preferredMonitor, preferredView, wndId, force = False) {
Local a, action, c0, hideTitle, i, isDecorated, isFloating, isManaged, l, m, n, replace, search, tags, body
Local wndControlList0, wndId0, wndIds, wndX, wndY, wndWidth, wndHeight
;; Manage any window only once.
- If InStr(Manager_allWndIds, wndId ";")
+ If InStr(Manager_allWndIds, wndId ";") And Not force
Return
body := 0
- If Window_isGhost(wndId)
- {
+ If Window_isGhost(wndId) {
Debug_logMessage("DEBUG[2] A window has given up the ghost (Ghost wndId: " . wndId . ")", 2)
body := Window_findHung(wndId)
- If body
- {
+ If body {
isManaged := InStr(Manager_managedWndIds, body ";")
m := Window_#%body%_monitor
tags := Window_#%body%_tags
@@ -342,17 +349,14 @@ Manager_manage(preferredMonitor, preferredView, wndId)
isFloating := Window_#%body%_isFloating
hideTitle := InStr(Bar_hideTitleWndIds, body ";")
action := ""
- }
- Else
- {
+ } Else
Debug_logMessage("DEBUG[1] No body could be found for ghost wndId: " . wndId, 1)
- }
}
;; Apply rules if the window is either a normal window or a ghost without a body.
- If (body = 0)
- {
+ If (body = 0) {
Manager_applyRules(wndId, isManaged, m, tags, isFloating, isDecorated, hideTitle, action)
+ isManaged := isManaged Or force
If (m = 0)
m := preferredMonitor
If (m < 0)
@@ -363,7 +367,7 @@ Manager_manage(preferredMonitor, preferredView, wndId)
tags := 1 << (preferredView - 1)
}
- a := Manager__setWinProperties( wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action)
+ a := Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action)
; Do view placement.
If isManaged {
diff --git a/usr/default_01.ini b/usr/default_01.ini
index 8ff0305..7803364 100644
--- a/usr/default_01.ini
+++ b/usr/default_01.ini
@@ -101,6 +101,7 @@
;Config_hotkey=#+d::Window_toggleDecor()
;Config_hotkey=#+f::View_toggleFloatingWindow()
;Config_hotkey=#+m::Manager_moveWindow()
+;Config_hotkey=#^+m::Manager_forceManaged()
;Config_hotkey=#+s::Manager_sizeWindow()
;Config_hotkey=#+x::Manager_maximizeWindow()
;Config_hotkey=#i::Manager_getWindowInfo()
diff --git a/usr/joten_01.ini b/usr/joten_01.ini
index 4754621..c2e04e7 100644
--- a/usr/joten_01.ini
+++ b/usr/joten_01.ini
@@ -109,6 +109,7 @@ Config_hotkey=#k::Manager_closeWindow()
;Config_hotkey=#+d::Window_toggleDecor()
;Config_hotkey=#+f::View_toggleFloatingWindow()
;Config_hotkey=#+m::Manager_moveWindow()
+;Config_hotkey=#^+m::Manager_forceManaged()
;Config_hotkey=#+s::Manager_sizeWindow()
;Config_hotkey=#+x::Manager_maximizeWindow()
Config_hotkey=#i::