Revised "Manager_setWindowMonitor"

... to allow setting absolute and relative values.
This commit is contained in:
joten 2015-01-28 20:26:43 +01:00
parent 7d7c20f716
commit 0d967e02fe
5 changed files with 21 additions and 18 deletions

View file

@ -13,8 +13,8 @@
3. `~` Migrated the following functions to `View_setLayoutProperty`: `View_setGapWidth`, `View_setMFactor`, `View_setMX`,
`View_setMY` and `View_rotateLayoutAxis`
4. `~` Revised the following functions to allow setting absolute and relative values: `Debug_setLogLevel`,
`Manager_activateMonitor`, `Monitor_activateView`, `Monitor_setWindowTag`, `View_setLayout`, `View_setMFactor`,
`View_shuffleWindow`
`Manager_activateMonitor`, `Manager_setWindowMonitor`, `Monitor_activateView`, `Monitor_setWindowTag`, `View_setLayout`,
`View_setMFactor`, `View_shuffleWindow`
5. `~` Revised the interface, i. e. the parameters, of the following functions for setting absolute and relative values -- but did
not implement the functionality: `Monitor_toggleWindowTag`, `View_activateWindow`
@ -42,6 +42,8 @@ not implement the functionality: `Monitor_toggleWindowTag`, `View_activateWindow
| | | `#+0::Monitor_setWindowTag(0)` | `#+0::Monitor_setWindowTag(10)` |
| | | `#.::Manager_activateMonitor(+1)` | `#.::Manager_activateMonitor(0, +1)` |
| | | `#,::Manager_activateMonitor(-1)` | `#,::Manager_activateMonitor(0, -1)` |
| | | `#+.::Manager_setWindowMonitor(+1)` | `#+.::Manager_setWindowMonitor(0, +1)` |
| | | `#+,::Manager_setWindowMonitor(-1)` | `#+,::Manager_setWindowMonitor(0, -1)` |
| 5. | | `#Down::View_activateWindow(+1)` | `#Down::View_activateWindow(0, +1)` |
| | | `#Up::View_activateWindow(-1)` | `#Up::View_activateWindow(0, -1)` |

View file

@ -214,17 +214,19 @@ for the active window, if it is not / is already set.
`#.::Manager_activateMonitor(0, +1)`
> Activate the next monitor in a multi-monitor environment. You may also
activate a specific monitor by using the first parameter, e. g.
`Manager_activateMonitor(1)` to activate the first monitor.
`Manager_activateMonitor(1)` will activate the first monitor.
`#,::Manager_activateMonitor(0, -1)`
> Activate the previous monitor in a multi-monitor environment.
`#+.::Manager_setWindowMonitor(+1)`
> Set the active window to the active view on the next monitor in a
multi-monitor environment.
`#+.::Manager_setWindowMonitor(0, +1)`
> Set the active window's view to the active view on the next monitor in a
multi-monitor environment. You may also set the active window on a specific
monitor by using the first parameter, e. g. `Manager_setWindowMonitor(1)` will
set the active window on the first monitor.
`#+,::Manager_setWindowMonitor(-1)`
> Set the active window to the active view on the previous monitor in a
`#+,::Manager_setWindowMonitor(0, -1)`
> Set the active window's view to the active view on the previous monitor in a
multi-monitor environment.
`#^+.::Manager_setViewMonitor(+1)`

View file

@ -323,7 +323,7 @@ Bar_GuiContextMenu:
Else If (SubStr(A_GuiControl, -4) = "_view")
{
If Not (SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) = Manager_aMonitor)
Manager_setWindowMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) - Manager_aMonitor)
Manager_setWindowMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6))
Monitor_setWindowTag(SubStr(A_GuiControl, InStr(A_GuiControl, "_#", False, 0) + 2, 1))
}
}

View file

@ -471,8 +471,8 @@ Config_UI_saveSession() {
;; Monitor management
#.::Manager_activateMonitor(0, +1)
#,::Manager_activateMonitor(0, -1)
#+.::Manager_setWindowMonitor(+1)
#+,::Manager_setWindowMonitor(-1)
#+.::Manager_setWindowMonitor(0, +1)
#+,::Manager_setWindowMonitor(0, -1)
#^+.::Manager_setViewMonitor(+1)
#^+,::Manager_setViewMonitor(-1)

View file

@ -961,15 +961,12 @@ Manager_setWindowBorders()
}
}
Manager_setWindowMonitor(d)
{
Manager_setWindowMonitor(i, d) {
Local aWndId, v
WinGet, aWndId, ID, A
If (Manager_monitorCount > 1 And InStr(Manager_managedWndIds, aWndId ";"))
{
Loop, % Config_viewCount
{
If (Manager_monitorCount > 1 And InStr(Manager_managedWndIds, aWndId ";")) {
Loop, % Config_viewCount {
StringReplace, View_#%Manager_aMonitor%_#%A_Index%_wndIds, View_#%Manager_aMonitor%_#%A_Index%_wndIds, %aWndId%`;,
If (aWndId = View_#%Manager_aMonitor%_#%A_Index%_aWndId)
View_#%Manager_aMonitor%_#%A_Index%_aWndId := 0
@ -979,7 +976,9 @@ Manager_setWindowMonitor(d)
View_arrange(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
;; Manually set the active monitor.
Manager_aMonitor := Manager_loop(Manager_aMonitor, d, 1, Manager_monitorCount)
If (i = 0)
i := Manager_aMonitor
Manager_aMonitor := Manager_loop(i, d, 1, Manager_monitorCount)
Monitor_moveWindow(Manager_aMonitor, aWndId)
v := Monitor_#%Manager_aMonitor%_aView_#1
Window_#%aWndId%_tags := 1 << v - 1