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. 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. 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 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 | | # | `-` 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()` | | 11. | | `#^m::Manager_minimizeWindow()` |
| 12. | | `Config_readinDateFormat` | | 12. | | `Config_readinDateFormat` |
| | | `Config_readinTimeFormat` | | | | `Config_readinTimeFormat` |
| 13. | | `#^+m::Manager_forceManaged()` |
### 8.4.0 ### 8.4.0

View File

@ -32,9 +32,6 @@ _Minimize_ the active window.
#### <kbd>Win</kbd><kbd>Shift</kbd><kbd>m</kbd> #### <kbd>Win</kbd><kbd>Shift</kbd><kbd>m</kbd>
_Move_ the active window _by key_. _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> #### <kbd>Win</kbd><kbd>Shift</kbd><kbd>s</kbd>
_Resize_ the active window _by key_. _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; } #window-management { position: absolute; bottom: 0; left: 93.5mm; }
#view-tag-management { position: absolute; top: 0; right: 0; } #view-tag-management { position: absolute; top: 0; right: 0; }
#gui-management { position: absolute; top: 30.4ex; right: 0; } #gui-management { position: absolute; top: 34.7ex; right: 0; }
#administration { position: absolute; top: 61.3ex; right: 0; } #administration { position: absolute; top: 70.2ex; right: 0; } /* 76.5ex - 57.5ex => 19ex / 3 */
#window-debugging { position: absolute; bottom: 0; right: 0; } #window-debugging { position: absolute; bottom: 0; right: 0; }
code { font-family: Ubuntu Mono, monospace; } code { font-family: Ubuntu Mono, monospace; }

View File

@ -54,10 +54,6 @@
<h4><kbd>Win</kbd><kbd>Shift</kbd><kbd>m</kbd></h4> <h4><kbd>Win</kbd><kbd>Shift</kbd><kbd>m</kbd></h4>
<p><em>Move</em> the active window <em>by key</em>.</p> <p><em>Move</em> the active window <em>by key</em>.</p>
</div> </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"> <div id="winshifts" class="section level4">
<h4><kbd>Win</kbd><kbd>Shift</kbd><kbd>s</kbd></h4> <h4><kbd>Win</kbd><kbd>Shift</kbd><kbd>s</kbd></h4>
<p><em>Resize</em> the active window <em>by key</em>.</p> <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. 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()` `Config_hotkey=#+s::Manager_sizeWindow()`
> _Resize_ the active window _by key_. > _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 | | | | | | f | x | x | | | | |
| h | | | x | | | | | h | | | x | | | |
| i | x | x | x | x | | | | i | x | x | x | x | | |
| m | x | x | x | x | | | | m | x | x | x | | | |
| n | | x | | | | | | n | | x | | | | |
| q | | | x | | | | | q | | | x | | | |
| r | | | x | | | | | r | | | x | | | |

View File

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

View File

@ -191,19 +191,8 @@ Manager_doMaintenance:
Manager_saveState() Manager_saveState()
Return Return
Manager_forceManaged() { Manager_getWindowInfo() {
Local aWndId Local aWndClass, aWndHeight, aWndId, aWndPId, aWndPName, aWndStyle, aWndTitle, aWndWidth, aWndX, aWndY, text, v
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
WinGet, aWndId, ID, A WinGet, aWndId, ID, A
WinGetClass, aWndClass, ahk_id %aWndId% WinGetClass, aWndClass, ahk_id %aWndId%
@ -214,23 +203,12 @@ Manager_getWindowInfo()
WinGet, aWndMinMax, MinMax, ahk_id %aWndId% WinGet, aWndMinMax, MinMax, ahk_id %aWndId%
WinGetPos, aWndX, aWndY, aWndWidth, aWndHeight, ahk_id %aWndId% WinGetPos, aWndX, aWndY, aWndWidth, aWndHeight, ahk_id %aWndId%
text := "ID: " aWndId "`nclass:`t" aWndClass "`ntitle:`t" aWndTitle text := "ID: " aWndId "`nclass:`t" aWndClass "`ntitle:`t" aWndTitle
rule := "Config_rule=" aWndClass ";" aWndTitle ";" If InStr(Bar_hideTitleWndIds, aWndId ";")
If InStr(Manager_managedWndIds, aWndId ";") text .= " [hidden]"
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"
text .= "`nprocess:`t" aWndPName " [" aWndPId "]`nstyle:`t" aWndStyle "`nmetrics:`tx: " aWndX ", y: " aWndY ", width: " aWndWidth ", height: " aWndHeight "`ntags:`t" Window_#%aWndId%_tags 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 If Window_#%aWndId%_isFloating
text .= " (floating)" text .= " [floating]"
text .= "`n`n" rule text .= "`n`nConfig_rule=" aWndClass ";" aWndTitle ";;" Manager_getWindowRule(aWndId)
MsgBox, 260, bug.n: Window Information, % text "`n`nCopy text to clipboard?" MsgBox, 260, bug.n: Window Information, % text "`n`nCopy text to clipboard?"
IfMsgBox Yes IfMsgBox Yes
Clipboard := text Clipboard := text
@ -258,6 +236,41 @@ Manager_getWindowList()
Clipboard := text 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() Manager_lockWorkStation()
{ {
Global Config_shellMsgDelay Global Config_shellMsgDelay
@ -283,19 +296,18 @@ Manager_loop(index, increment, lowerBound, upperBound) {
Return, lowerBound + lowerBoundBasedIndex 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 Local a
If Not Instr(Manager_allWndIds, wndId ";") If Not InStr(Manager_allWndIds, wndId ";")
Manager_allWndIds .= wndId ";" Manager_allWndIds .= wndId ";"
If (isManaged) If (isManaged) {
{ If (action = "close" Or action = "maximize" Or action = "restore")
If (action = "close" Or action = "maximize")
Window_%action%(wndId) Window_%action%(wndId)
Manager_managedWndIds .= wndId ";" If Not InStr(Manager_managedWndIds, wndId ";")
Manager_managedWndIds .= wndId ";"
Monitor_moveWindow(m, wndId) Monitor_moveWindow(m, wndId)
Window_#%wndId%_tags := tags Window_#%wndId%_tags := tags
Window_#%wndId%_isDecorated := isDecorated Window_#%wndId%_isDecorated := isDecorated
@ -308,20 +320,17 @@ Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hi
Window_set(wndId, "Style", "-0xC00000") Window_set(wndId, "Style", "-0xC00000")
a := Window_#%wndId%_tags & (1 << (Monitor_#%m%_aView_#1 - 1)) 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. ;; A newly created window defines the active monitor, if it is visible.
Manager_aMonitor := m Manager_aMonitor := m
Manager_winActivate(wndId) Manager_winActivate(wndId)
} } Else {
Else
{
Manager_hideShow := True Manager_hideShow := True
Window_hide(wndId) Window_hide(wndId)
Manager_hideShow := False Manager_hideShow := False
} }
} }
If hideTitle If hideTitle And Not InStr(Bar_hideTitleWndIds, wndId ";")
Bar_hideTitleWndIds .= wndId . ";" Bar_hideTitleWndIds .= wndId . ";"
Return, a 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. ;; Accept a window to be added to the system for management.
;; Provide a monitor and view preference, but don't override the config. ;; 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 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 Local wndControlList0, wndId0, wndIds, wndX, wndY, wndWidth, wndHeight
;; Manage any window only once. ;; Manage any window only once.
If InStr(Manager_allWndIds, wndId ";") And Not force If InStr(Manager_allWndIds, wndId ";") And (rule = "")
Return Return
body := 0 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. ;; 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) 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) If (m = 0)
m := preferredMonitor m := preferredMonitor
If (m < 0) 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() { Manager_registerShellHook() {
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

View File

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

View File

@ -101,7 +101,6 @@
;Config_hotkey=#+d::Window_toggleDecor() ;Config_hotkey=#+d::Window_toggleDecor()
;Config_hotkey=#+f::View_toggleFloatingWindow() ;Config_hotkey=#+f::View_toggleFloatingWindow()
;Config_hotkey=#+m::Manager_moveWindow() ;Config_hotkey=#+m::Manager_moveWindow()
;Config_hotkey=#^+m::Manager_forceManaged()
;Config_hotkey=#+s::Manager_sizeWindow() ;Config_hotkey=#+s::Manager_sizeWindow()
;Config_hotkey=#+x::Manager_maximizeWindow() ;Config_hotkey=#+x::Manager_maximizeWindow()
;Config_hotkey=#i::Manager_getWindowInfo() ;Config_hotkey=#i::Manager_getWindowInfo()

View File

@ -109,7 +109,7 @@ Config_hotkey=#k::Manager_closeWindow()
;Config_hotkey=#+d::Window_toggleDecor() ;Config_hotkey=#+d::Window_toggleDecor()
;Config_hotkey=#+f::View_toggleFloatingWindow() ;Config_hotkey=#+f::View_toggleFloatingWindow()
;Config_hotkey=#+m::Manager_moveWindow() ;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=#+s::Manager_sizeWindow()
;Config_hotkey=#+x::Manager_maximizeWindow() ;Config_hotkey=#+x::Manager_maximizeWindow()
Config_hotkey=#i:: Config_hotkey=#i::