Combined two earlier commits

+ cf55b0b47e
+ 7e190a0076
This commit is contained in:
joten 2015-12-23 19:09:52 +01:00
parent cf55b0b47e
commit d0eea76509
12 changed files with 85 additions and 72 deletions

View File

@ -25,7 +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`.
13. `+` Added a function to override the rules applied from `Config.ini` for the active window.
| # | `-` or `~` Configuration Variables or <br/> `-` Hotkey Functions | `+` Configuration Variables or <br/> `+` Hotkey Functions |
| ---:| ---------------------------------------------------------------- | --------------------------------------------------------- |
@ -88,7 +88,6 @@ 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

View File

@ -32,9 +32,6 @@ _Minimize_ the active window.
#### <kbd>Win</kbd><kbd>Shift</kbd><kbd>m</kbd>
_Move_ the active window _by key_.
#### <kbd>Win</kbd><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>m</kbd>
_Force_ the active window to be _managed_.
#### <kbd>Win</kbd><kbd>Shift</kbd><kbd>s</kbd>
_Resize_ the active window _by key_.

View File

@ -63,8 +63,8 @@ h2 { position: absolute; top: 0; left: 93.5mm; }
#window-management { position: absolute; bottom: 0; left: 93.5mm; }
#view-tag-management { position: absolute; top: 0; right: 0; }
#gui-management { position: absolute; top: 30.4ex; right: 0; }
#administration { position: absolute; top: 61.3ex; right: 0; }
#gui-management { position: absolute; top: 34.7ex; right: 0; }
#administration { position: absolute; top: 70.2ex; right: 0; } /* 76.5ex - 57.5ex => 19ex / 3 */
#window-debugging { position: absolute; bottom: 0; right: 0; }
code { font-family: Ubuntu Mono, monospace; }

View File

@ -54,10 +54,6 @@
<h4><kbd>Win</kbd><kbd>Shift</kbd><kbd>m</kbd></h4>
<p><em>Move</em> the active window <em>by key</em>.</p>
</div>
<div id="winctrlshiftm" class="section level4">
<h4><kbd>Win</kbd><kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>m</kbd></h4>
<p><em>Force</em> the active window to be <em>managed</em>.</p>
</div>
<div id="winshifts" class="section level4">
<h4><kbd>Win</kbd><kbd>Shift</kbd><kbd>s</kbd></h4>
<p><em>Resize</em> the active window <em>by key</em>.</p>

Binary file not shown.

View File

@ -59,19 +59,6 @@ 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_.

View File

@ -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 | x | | |
| m | x | x | x | | | |
| n | | x | | | | |
| q | | | x | | | |
| r | | | x | | | |

View File

@ -406,7 +406,6 @@ Config_UI_saveSession() {
#+f::View_toggleFloatingWindow()
#+m::Manager_moveWindow()
#^m::Manager_minimizeWindow()
#^+m::Manager_forceManaged()
#+s::Manager_sizeWindow()
#+x::Manager_maximizeWindow()
#i::Manager_getWindowInfo()

View File

@ -191,19 +191,8 @@ 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
Manager_getWindowInfo() {
Local aWndClass, aWndHeight, aWndId, aWndPId, aWndPName, aWndStyle, aWndTitle, aWndWidth, aWndX, aWndY, text, v
WinGet, aWndId, ID, A
WinGetClass, aWndClass, ahk_id %aWndId%
@ -214,23 +203,12 @@ Manager_getWindowInfo()
WinGet, aWndMinMax, MinMax, ahk_id %aWndId%
WinGetPos, aWndX, aWndY, aWndWidth, aWndHeight, ahk_id %aWndId%
text := "ID: " aWndId "`nclass:`t" aWndClass "`ntitle:`t" aWndTitle
rule := "Config_rule=" aWndClass ";" aWndTitle ";"
If InStr(Manager_managedWndIds, aWndId ";")
rule .= ";1"
Else
rule .= ";0"
rule .= ";" Window_#%aWndId%_monitor ";" Window_#%aWndId%_tags ";" Window_#%aWndId%_isFloating ";" Window_#%aWndId%_isDecorated
If InStr(Bar_hideTitleWndIds, aWndId ";") {
text .= " (hidden)"
rule .= ";1;"
} Else
rule .= ";0;"
If (aWndMinMax = 1)
rule .= "maximize"
If InStr(Bar_hideTitleWndIds, aWndId ";")
text .= " [hidden]"
text .= "`nprocess:`t" aWndPName " [" aWndPId "]`nstyle:`t" aWndStyle "`nmetrics:`tx: " aWndX ", y: " aWndY ", width: " aWndWidth ", height: " aWndHeight "`ntags:`t" Window_#%aWndId%_tags
If Window_#%aWndId%_isFloating
text .= " (floating)"
text .= "`n`n" rule
text .= " [floating]"
text .= "`n`nConfig_rule=" aWndClass ";" aWndTitle ";;" Manager_getWindowRule(aWndId)
MsgBox, 260, bug.n: Window Information, % text "`n`nCopy text to clipboard?"
IfMsgBox Yes
Clipboard := text
@ -258,6 +236,41 @@ Manager_getWindowList()
Clipboard := text
}
Manager_getWindowRule(wndId) {
Local rule, wndMinMax
rule := ""
WinGet, wndMinMax, MinMax, ahk_id %wndId%
If InStr(Manager_managedWndIds, wndId ";")
rule .= "1;"
Else
rule .= "0;"
If (Window_#%wndId%_monitor = "")
rule .= "0;"
Else
rule .= Window_#%wndId%_monitor ";"
If (Window_#%wndId%_tags = "")
rule .= "0;"
Else
rule .= Window_#%wndId%_tags ";"
If Window_#%wndId%_isFloating
rule .= "1;"
Else
rule .= "0;"
If Window_#%wndId%_isDecorated
rule .= "1;"
Else
rule .= "0;"
If InStr(Bar_hideTitleWndIds, wndId ";")
rule .= "1;"
Else
rule .= "0;"
If (wndMinMax = 1)
rule .= "maximize"
Return, rule
}
Manager_lockWorkStation()
{
Global Config_shellMsgDelay
@ -283,19 +296,18 @@ Manager_loop(index, increment, lowerBound, upperBound) {
Return, lowerBound + lowerBoundBasedIndex
}
Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action = "")
{
Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action = "") {
Local a
If Not Instr(Manager_allWndIds, wndId ";")
If Not InStr(Manager_allWndIds, wndId ";")
Manager_allWndIds .= wndId ";"
If (isManaged)
{
If (action = "close" Or action = "maximize")
If (isManaged) {
If (action = "close" Or action = "maximize" Or action = "restore")
Window_%action%(wndId)
Manager_managedWndIds .= wndId ";"
If Not InStr(Manager_managedWndIds, wndId ";")
Manager_managedWndIds .= wndId ";"
Monitor_moveWindow(m, wndId)
Window_#%wndId%_tags := tags
Window_#%wndId%_isDecorated := isDecorated
@ -308,20 +320,17 @@ Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hi
Window_set(wndId, "Style", "-0xC00000")
a := Window_#%wndId%_tags & (1 << (Monitor_#%m%_aView_#1 - 1))
If a
{
If a {
;; A newly created window defines the active monitor, if it is visible.
Manager_aMonitor := m
Manager_winActivate(wndId)
}
Else
{
} Else {
Manager_hideShow := True
Window_hide(wndId)
Manager_hideShow := False
}
}
If hideTitle
If hideTitle And Not InStr(Bar_hideTitleWndIds, wndId ";")
Bar_hideTitleWndIds .= wndId . ";"
Return, a
@ -329,12 +338,13 @@ 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, force = False) {
Manager_manage(preferredMonitor, preferredView, wndId, rule = "") {
Local a, action, c0, hideTitle, i, isDecorated, isFloating, isManaged, l, m, n, replace, search, tags, body
Local rule0, rule1, rule2, rule3, rule4, rule5, rule6, rule7
Local wndControlList0, wndId0, wndIds, wndX, wndY, wndWidth, wndHeight
;; Manage any window only once.
If InStr(Manager_allWndIds, wndId ";") And Not force
If InStr(Manager_allWndIds, wndId ";") And (rule = "")
Return
body := 0
@ -356,7 +366,16 @@ Manager_manage(preferredMonitor, preferredView, wndId, force = False) {
;; Apply rules if the window is either a normal window or a ghost without a body.
If (body = 0) {
Manager_applyRules(wndId, isManaged, m, tags, isFloating, isDecorated, hideTitle, action)
isManaged := isManaged Or force
If Not (rule = "") {
StringSplit, rule, rule, `;
isManaged := rule1
m := rule2
tags := rule3
isFloating := rule4
isDecorated := rule5
hideTitle := rule6
action := rule7
}
If (m = 0)
m := preferredMonitor
If (m < 0)
@ -609,6 +628,22 @@ Manager_onShellMessage(wParam, lParam) {
}
}
Manager_override(rule = "") {
Local aWndId, aWndMinMax
WinGet, aWndId, ID, A
If (rule = "") {
rule := Manager_getWindowRule(aWndId)
InputBox, rule, bug.n: Override, % "Which rule should be applied?`n`n<is managed>;<m>;<tags>;<is floating>;<is decorated>;<hide title>;<action>",, 483, 152,,,,, % rule
If Not (ErrorLevel = 0)
Return
}
Manager_manage(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1, aWndId, rule)
If Config_dynamicTiling
View_arrange(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
Bar_updateView(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
}
Manager_registerShellHook() {
WM_DISPLAYCHANGE := 126 ;; This message is sent when the display resolution has changed.
Gui, +LastFound

View File

@ -85,6 +85,7 @@ View_activateWindow(i, d = 0) {
View_addWindow(m, v, wndId) {
Local i, mSplit, n, replace, search
StringReplace, View_#%m%_#%v%_wndIds, View_#%m%_#%v%_wndIds, % wndId ";",, All
If Tiler_isActive(m, v) And ((Config_newWndPosition = "masterBottom") Or (Config_newWndPosition = "stackTop")) {
n := View_getTiledWndIds(m, v)
mSplit := View_#%m%_#%v%_layoutMX * View_#%m%_#%v%_layoutMY

View File

@ -101,7 +101,6 @@
;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()

View File

@ -109,7 +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=#^o::Manager_override(1;0;0;0;1;0;)
;Config_hotkey=#+s::Manager_sizeWindow()
;Config_hotkey=#+x::Manager_maximizeWindow()
Config_hotkey=#i::