Update the layout of the current view if it is re-activated.
This commit is contained in:
parent
5276471f49
commit
8e5e42a653
1 changed files with 57 additions and 49 deletions
106
src/Monitor.ahk
106
src/Monitor.ahk
|
@ -40,56 +40,64 @@ Monitor_activateView(v) {
|
||||||
v := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, +1, 1, Config_viewCount)
|
v := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, +1, 1, Config_viewCount)
|
||||||
Else If (v = "<")
|
Else If (v = "<")
|
||||||
v := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, -1, 1, Config_viewCount)
|
v := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, -1, 1, Config_viewCount)
|
||||||
If (v > 0) And (v <= Config_viewCount) And Not Manager_hideShow And Not (v = Monitor_#%Manager_aMonitor%_aView_#1) {
|
|
||||||
aView := Monitor_#%Manager_aMonitor%_aView_#1
|
;Log_msg("Monitor_activateView(" . v . ") wndIds: " . View_#%m%_#%aView%_wndIds)
|
||||||
WinGet, aWndId, ID, A
|
|
||||||
If WinExist("ahk_id" aWndId) And InStr(View_#%Manager_aMonitor%_#%aView%_wndIds, aWndId ";") {
|
If (v <= 0) Or (v > Config_viewCount) Or Manager_hideShow
|
||||||
WinGetClass, aWndClass, ahk_id %aWndId%
|
Return
|
||||||
WinGetTitle, aWndTitle, ahk_id %aWndId%
|
; Re-arrange the windows on the view.
|
||||||
If Not (aWndClass = "Progman") And Not (aWndClass = "AutoHotkeyGui" And SubStr(aWndTitle, 1, 10) = "bug.n_BAR_") And Not (aWndClass = "DesktopBackgroundClass")
|
If (v = Monitor_#%Manager_aMonitor%_aView_#1) {
|
||||||
View_#%Manager_aMonitor%_#%aView%_aWndId := aWndId
|
View_arrange(Manager_aMonitor, v)
|
||||||
}
|
Return
|
||||||
|
|
||||||
n := Config_syncMonitorViews
|
|
||||||
If (n = 1)
|
|
||||||
n := Manager_monitorCount
|
|
||||||
Else If (n < 1)
|
|
||||||
n := 1
|
|
||||||
Loop, % n {
|
|
||||||
If (n = 1)
|
|
||||||
m := Manager_aMonitor
|
|
||||||
Else
|
|
||||||
m := A_Index
|
|
||||||
|
|
||||||
Monitor_#%m%_aView_#2 := aView
|
|
||||||
Monitor_#%m%_aView_#1 := v
|
|
||||||
|
|
||||||
Manager_hideShow := True
|
|
||||||
StringTrimRight, wndIds, View_#%m%_#%aView%_wndIds, 1
|
|
||||||
Loop, PARSE, wndIds, `;
|
|
||||||
If Not (Manager_#%A_LoopField%_tags & (1 << v - 1))
|
|
||||||
WinHide, ahk_id %A_LoopField%
|
|
||||||
StringTrimRight, wndIds, View_#%m%_#%v%_wndIds, 1
|
|
||||||
Loop, PARSE, wndIds, `;
|
|
||||||
WinShow, ahk_id %A_LoopField%
|
|
||||||
Manager_hideShow := False
|
|
||||||
|
|
||||||
Bar_updateView(m, aView)
|
|
||||||
Bar_updateView(m, v)
|
|
||||||
|
|
||||||
View_arrange(m, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
wndId := View_#%Manager_aMonitor%_#%v%_aWndId
|
|
||||||
If Not (wndId And WinExist("ahk_id" wndId)) {
|
|
||||||
If View_#%Manager_aMonitor%_#%v%_wndIds {
|
|
||||||
wndId := SubStr(View_#%Manager_aMonitor%_#%v%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%v%_wndIds, ";")-1)
|
|
||||||
View_#%Manager_aMonitor%_#%v%_aWndId := wndId
|
|
||||||
} Else
|
|
||||||
wndId := 0
|
|
||||||
}
|
|
||||||
Manager_winActivate(wndId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aView := Monitor_#%Manager_aMonitor%_aView_#1
|
||||||
|
WinGet, aWndId, ID, A
|
||||||
|
If WinExist("ahk_id" aWndId) And InStr(View_#%Manager_aMonitor%_#%aView%_wndIds, aWndId ";") {
|
||||||
|
WinGetClass, aWndClass, ahk_id %aWndId%
|
||||||
|
WinGetTitle, aWndTitle, ahk_id %aWndId%
|
||||||
|
If Not (aWndClass = "Progman") And Not (aWndClass = "AutoHotkeyGui" And SubStr(aWndTitle, 1, 10) = "bug.n_BAR_") And Not (aWndClass = "DesktopBackgroundClass")
|
||||||
|
View_#%Manager_aMonitor%_#%aView%_aWndId := aWndId
|
||||||
|
}
|
||||||
|
|
||||||
|
n := 1
|
||||||
|
If (Config_syncMonitorViews > 0)
|
||||||
|
n := Manager_monitorCount
|
||||||
|
Loop, % n {
|
||||||
|
If (n = 1)
|
||||||
|
m := Manager_aMonitor
|
||||||
|
Else
|
||||||
|
m := A_Index
|
||||||
|
|
||||||
|
Monitor_#%m%_aView_#2 := aView
|
||||||
|
Monitor_#%m%_aView_#1 := v
|
||||||
|
|
||||||
|
Manager_hideShow := True
|
||||||
|
StringTrimRight, wndIds, View_#%m%_#%aView%_wndIds, 1
|
||||||
|
Loop, PARSE, wndIds, `;
|
||||||
|
If Not (Manager_#%A_LoopField%_tags & (1 << v - 1))
|
||||||
|
WinHide, ahk_id %A_LoopField%
|
||||||
|
StringTrimRight, wndIds, View_#%m%_#%v%_wndIds, 1
|
||||||
|
DetectHiddenWindows, On
|
||||||
|
View_arrange(m, v)
|
||||||
|
DetectHiddenWindows, Off
|
||||||
|
Loop, PARSE, wndIds, `;
|
||||||
|
WinShow, ahk_id %A_LoopField%
|
||||||
|
Manager_hideShow := False
|
||||||
|
|
||||||
|
Bar_updateView(m, aView)
|
||||||
|
Bar_updateView(m, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
wndId := View_#%Manager_aMonitor%_#%v%_aWndId
|
||||||
|
If Not (wndId And WinExist("ahk_id" wndId)) {
|
||||||
|
If View_#%Manager_aMonitor%_#%v%_wndIds {
|
||||||
|
wndId := SubStr(View_#%Manager_aMonitor%_#%v%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%v%_wndIds, ";")-1)
|
||||||
|
View_#%Manager_aMonitor%_#%v%_aWndId := wndId
|
||||||
|
} Else
|
||||||
|
wndId := 0
|
||||||
|
}
|
||||||
|
Manager_winActivate(wndId)
|
||||||
}
|
}
|
||||||
|
|
||||||
Monitor_get(x, y) {
|
Monitor_get(x, y) {
|
||||||
|
|
Loading…
Reference in a new issue