2012-12-04 02:52:43 +00:00
|
|
|
/*
|
|
|
|
bug.n -- tiling window management
|
2014-08-14 10:06:08 +00:00
|
|
|
Copyright (c) 2010-2014 Joshua Fuhs, joten
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-12-04 02:52:43 +00:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-12-04 02:52:43 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-12-04 02:52:43 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2012-12-05 12:39:51 +00:00
|
|
|
|
|
|
|
@version 8.4.0
|
2012-12-04 02:52:43 +00:00
|
|
|
*/
|
2011-07-27 17:43:34 +00:00
|
|
|
|
2012-12-06 00:03:27 +00:00
|
|
|
|
2013-03-25 21:30:12 +00:00
|
|
|
Monitor_init(m, doRestore)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Global
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Monitor_#%m%_aView_#1 := 1
|
|
|
|
Monitor_#%m%_aView_#2 := 1
|
|
|
|
Monitor_#%m%_showBar := Config_showBar
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, % Config_viewCount
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
View_init(m, A_Index)
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-12-05 23:55:38 +00:00
|
|
|
If doRestore
|
|
|
|
Config_restoreLayout(Main_autoLayout, m)
|
|
|
|
Else
|
|
|
|
Config_restoreLayout(Config_filePath, m)
|
2012-11-27 03:13:38 +00:00
|
|
|
Monitor_getWorkArea(m)
|
|
|
|
Bar_init(m)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_activateView(v)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
|
|
|
Local aView, aWndId, m, n, wndId, wndIds
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
If (v = -1)
|
|
|
|
v := Monitor_#%Manager_aMonitor%_aView_#2
|
|
|
|
Else If (v = ">")
|
|
|
|
v := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, +1, 1, Config_viewCount)
|
|
|
|
Else If (v = "<")
|
|
|
|
v := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, -1, 1, Config_viewCount)
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-12-04 02:52:43 +00:00
|
|
|
Debug_logMessage("DEBUG[1] Monitor_activateView(" . v . ") Manager_aMonitor: " . Manager_aMonitor . "; wndIds: " . View_#%Manager_aMonitor%_#%v%_wndIds, 1)
|
2012-11-27 03:13:38 +00:00
|
|
|
If (v <= 0) Or (v > Config_viewCount) Or Manager_hideShow
|
|
|
|
Return
|
2012-12-04 02:52:43 +00:00
|
|
|
;; Re-arrange the windows on the active view.
|
2012-12-05 12:39:51 +00:00
|
|
|
If (v = Monitor_#%Manager_aMonitor%_aView_#1)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
View_arrange(Manager_aMonitor, v)
|
|
|
|
Return
|
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
aView := Monitor_#%Manager_aMonitor%_aView_#1
|
2012-12-04 02:52:43 +00:00
|
|
|
aWndId := View_getActiveWindow(Manager_aMonitor, aView)
|
|
|
|
If aWndId
|
|
|
|
View_#%Manager_aMonitor%_#%aView%_aWndId := aWndId
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-12-04 02:52:43 +00:00
|
|
|
n := Config_syncMonitorViews
|
|
|
|
If (n = 1)
|
2012-11-27 03:13:38 +00:00
|
|
|
n := Manager_monitorCount
|
2012-12-04 02:52:43 +00:00
|
|
|
Else If (n < 1)
|
|
|
|
n := 1
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, % n
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
If (n = 1)
|
|
|
|
m := Manager_aMonitor
|
|
|
|
Else
|
|
|
|
m := A_Index
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Monitor_#%m%_aView_#2 := aView
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_#%m%_aView_#1 := v
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
|
|
|
SetWinDelay, 0
|
|
|
|
StringTrimRight, wndIds, View_#%m%_#%aView%_wndIds, 1
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, PARSE, wndIds, `;
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
If Not (Manager_#%A_LoopField%_tags & (1 << v - 1))
|
|
|
|
Manager_winHide(A_LoopField)
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-11-27 03:13:38 +00:00
|
|
|
SetWinDelay, 10
|
|
|
|
DetectHiddenWindows, On
|
|
|
|
View_arrange(m, v)
|
|
|
|
DetectHiddenWindows, Off
|
|
|
|
StringTrimRight, wndIds, View_#%m%_#%v%_wndIds, 1
|
|
|
|
SetWinDelay, 0
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, PARSE, wndIds, `;
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_winShow(A_LoopField)
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-11-27 03:13:38 +00:00
|
|
|
SetWinDelay, 10
|
|
|
|
Manager_hideShow := False
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Bar_updateView(m, aView)
|
|
|
|
Bar_updateView(m, v)
|
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
wndId := View_#%Manager_aMonitor%_#%v%_aWndId
|
2012-12-05 12:39:51 +00:00
|
|
|
If Not (wndId And WinExist("ahk_id" wndId))
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If View_#%Manager_aMonitor%_#%v%_wndIds
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
wndId := SubStr(View_#%Manager_aMonitor%_#%v%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%v%_wndIds, ";")-1)
|
|
|
|
View_#%Manager_aMonitor%_#%v%_aWndId := wndId
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
2012-12-04 02:52:43 +00:00
|
|
|
Else
|
2012-11-27 03:13:38 +00:00
|
|
|
wndId := 0
|
|
|
|
}
|
|
|
|
Manager_winActivate(wndId)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_get(x, y)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Local m
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
m := 0
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, % Manager_monitorCount
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Check if the window is on this monitor.
|
2012-12-05 12:39:51 +00:00
|
|
|
If (x >= Monitor_#%A_Index%_x && x <= Monitor_#%A_Index%_x+Monitor_#%A_Index%_width && y >= Monitor_#%A_Index%_y && y <= Monitor_#%A_Index%_y+Monitor_#%A_Index%_height)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
m := A_Index
|
|
|
|
Break
|
|
|
|
}
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Return, m
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_getWorkArea(m)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2014-12-13 15:12:38 +00:00
|
|
|
Local bHeight, bTop, x, y
|
2012-11-27 03:13:38 +00:00
|
|
|
Local monitor, monitorBottom, monitorLeft, monitorRight, monitorTop
|
|
|
|
Local wndClasses, wndHeight, wndId, wndWidth, wndX, wndY
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
SysGet, monitor, Monitor, %m%
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2014-10-06 11:33:29 +00:00
|
|
|
wndClasses := "Shell_TrayWnd;Shell_SecondaryTrayWnd"
|
|
|
|
;; @TODO What about third and so forth TrayWnd?
|
2012-11-27 03:13:38 +00:00
|
|
|
If Config_bbCompatibility
|
|
|
|
wndClasses .= ";bbLeanBar;bbSlit;BBToolbar;SystemBarEx"
|
|
|
|
Loop, PARSE, wndClasses, `;
|
|
|
|
{
|
|
|
|
wndId := WinExist("ahk_class " A_LoopField)
|
2012-12-05 12:39:51 +00:00
|
|
|
If wndId
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
WinGetPos, wndX, wndY, wndWidth, wndHeight, ahk_id %wndId%
|
|
|
|
x := wndX + wndWidth / 2
|
|
|
|
y := wndY + wndHeight / 2
|
2012-12-05 12:39:51 +00:00
|
|
|
If (x >= monitorLeft && x <= monitorRight && y >= monitorTop && y <= monitorBottom)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
If (A_LoopField = "Shell_TrayWnd")
|
|
|
|
Manager_taskBarMonitor := m
|
2012-12-05 12:39:51 +00:00
|
|
|
|
|
|
|
If (wndHeight < wndWidth)
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Horizontal
|
2012-12-05 12:39:51 +00:00
|
|
|
If (wndY <= monitorTop)
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Top
|
2012-11-27 03:13:38 +00:00
|
|
|
wndHeight += wndY - monitorTop
|
|
|
|
monitorTop += wndHeight
|
2012-12-04 02:52:43 +00:00
|
|
|
If (A_LoopField = "Shell_TrayWnd")
|
|
|
|
Manager_taskBarPos := "top"
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Bottom
|
2012-11-27 03:13:38 +00:00
|
|
|
wndHeight := monitorBottom - wndY
|
|
|
|
monitorBottom -= wndHeight
|
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Vertical
|
2012-12-05 12:39:51 +00:00
|
|
|
If (wndX <= monitorLeft)
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Left
|
2012-11-27 03:13:38 +00:00
|
|
|
wndWidth += wndX
|
|
|
|
monitorLeft += wndWidth
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{ ;; Right
|
2012-11-27 03:13:38 +00:00
|
|
|
wndWidth := monitorRight - wndX
|
|
|
|
monitorRight -= wndWidth
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-12-13 15:12:38 +00:00
|
|
|
bHeight := Round(Bar_height / Config_scalingFactor)
|
2012-12-04 02:52:43 +00:00
|
|
|
bTop := 0
|
2012-12-05 12:39:51 +00:00
|
|
|
If Monitor_#%m%_showBar
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If (Config_verticalBarPos = "top" Or (Config_verticalBarPos = "tray" And Not m = Manager_taskBarMonitor))
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
bTop := monitorTop
|
2014-12-13 15:12:38 +00:00
|
|
|
monitorTop += bHeight
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else If (Config_verticalBarPos = "bottom")
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2014-12-13 15:12:38 +00:00
|
|
|
bTop := monitorBottom - bHeight
|
|
|
|
monitorBottom -= bHeight
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Monitor_#%m%_height := monitorBottom - monitorTop
|
|
|
|
Monitor_#%m%_width := monitorRight - monitorLeft
|
|
|
|
Monitor_#%m%_x := monitorLeft
|
|
|
|
Monitor_#%m%_y := monitorTop
|
|
|
|
Monitor_#%m%_barY := bTop
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_moveWindow(m, wndId)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Global
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_#%wndId%_monitor := m
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_setWindowTag(t)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Local aView, aWndId, wndId
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
If (t = ">")
|
|
|
|
t := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, +1, 1, Config_viewCount)
|
|
|
|
Else If (t = "<")
|
|
|
|
t := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, -1, 1, Config_viewCount)
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
WinGet, aWndId, ID, A
|
2012-12-05 12:39:51 +00:00
|
|
|
If (InStr(Manager_managedWndIds, aWndId ";") And t >= 0 And t <= Config_viewCount)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If (t = 0)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, % Config_viewCount
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If Not (Manager_#%aWndId%_tags & (1 << A_Index - 1))
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
View_#%Manager_aMonitor%_#%A_Index%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%A_Index%_wndIds
|
|
|
|
View_#%Manager_aMonitor%_#%A_Index%_aWndId := aWndId
|
|
|
|
Bar_updateView(Manager_aMonitor, A_Index)
|
|
|
|
Manager_#%aWndId%_tags += 1 << A_Index - 1
|
|
|
|
}
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, % Config_viewCount
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If Not (A_index = t)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
StringReplace, View_#%Manager_aMonitor%_#%A_Index%_wndIds, View_#%Manager_aMonitor%_#%A_Index%_wndIds, %aWndId%`;,
|
2012-11-27 03:13:38 +00:00
|
|
|
View_#%Manager_aMonitor%_#%A_Index%_aWndId := 0
|
|
|
|
Bar_updateView(Manager_aMonitor, A_Index)
|
|
|
|
}
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
If Not (Manager_#%aWndId%_tags & (1 << t - 1))
|
|
|
|
View_#%Manager_aMonitor%_#%t%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%t%_wndIds
|
|
|
|
View_#%Manager_aMonitor%_#%t%_aWndId := aWndId
|
|
|
|
Manager_#%aWndId%_tags := 1 << t - 1
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
aView := Monitor_#%Manager_aMonitor%_aView_#1
|
2012-12-05 12:39:51 +00:00
|
|
|
If Not (t = aView)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
|
|
|
wndId := SubStr(View_#%Manager_aMonitor%_#%aView%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%aView%_wndIds, ";")-1)
|
|
|
|
Manager_winActivate(wndId)
|
|
|
|
Manager_hideShow := False
|
|
|
|
If Config_viewFollowsTagged
|
|
|
|
Monitor_activateView(t)
|
2012-12-05 12:39:51 +00:00
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
|
|
|
Manager_winHide(aWndId)
|
|
|
|
Manager_hideShow := False
|
2014-03-03 10:56:37 +00:00
|
|
|
If Config_dynamicTiling
|
|
|
|
View_arrange(Manager_aMonitor, aView)
|
2012-11-27 03:13:38 +00:00
|
|
|
Bar_updateView(Manager_aMonitor, t)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_toggleBar()
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Global
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
Monitor_#%Manager_aMonitor%_showBar := Not Monitor_#%Manager_aMonitor%_showBar
|
|
|
|
Bar_toggleVisibility(Manager_aMonitor)
|
|
|
|
Monitor_getWorkArea(Manager_aMonitor)
|
|
|
|
View_arrange(Manager_aMonitor, Monitor_#%Manager_aMonitor%_aView_#1)
|
|
|
|
Manager_winActivate(Bar_aWndId)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2013-03-25 21:30:12 +00:00
|
|
|
Monitor_toggleNotifyIconOverflowWindow()
|
|
|
|
{
|
|
|
|
Static wndId
|
|
|
|
|
|
|
|
If Not WinExist("ahk_class NotifyIconOverflowWindow")
|
|
|
|
{
|
|
|
|
WinGet, wndId, ID, A
|
|
|
|
DetectHiddenWindows, On
|
|
|
|
WinShow, ahk_class NotifyIconOverflowWindow
|
|
|
|
WinActivate, ahk_class NotifyIconOverflowWindow
|
|
|
|
DetectHiddenWindows, Off
|
|
|
|
}
|
|
|
|
Else
|
|
|
|
{
|
|
|
|
WinHide, ahk_class NotifyIconOverflowWindow
|
|
|
|
WinActivate, ahk_id %wndId%
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_toggleTaskBar()
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Local m
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
m := Manager_aMonitor
|
2012-12-05 12:39:51 +00:00
|
|
|
If (m = Manager_taskBarMonitor)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_showTaskBar := Not Manager_showTaskBar
|
|
|
|
Manager_hideShow := True
|
2012-12-05 12:39:51 +00:00
|
|
|
If Not Manager_showTaskBar
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
WinHide, Start ahk_class Button
|
|
|
|
WinHide, ahk_class Shell_TrayWnd
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
WinShow, Start ahk_class Button
|
|
|
|
WinShow, ahk_class Shell_TrayWnd
|
|
|
|
}
|
|
|
|
Manager_hideShow := False
|
|
|
|
Monitor_getWorkArea(m)
|
|
|
|
Bar_move(m)
|
|
|
|
View_arrange(m, Monitor_#%m%_aView_#1)
|
|
|
|
}
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 12:39:51 +00:00
|
|
|
Monitor_toggleWindowTag(t)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Local aWndId, wndId
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
WinGet, aWndId, ID, A
|
2012-12-05 12:39:51 +00:00
|
|
|
If (InStr(Manager_managedWndIds, aWndId ";") And t >= 0 And t <= Config_viewCount)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If (Manager_#%aWndId%_tags & (1 << t - 1))
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-12-05 12:39:51 +00:00
|
|
|
If Not ((Manager_#%aWndId%_tags - (1 << t - 1)) = 0)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_#%aWndId%_tags -= 1 << t - 1
|
2012-12-05 12:39:51 +00:00
|
|
|
StringReplace, View_#%Manager_aMonitor%_#%t%_wndIds, View_#%Manager_aMonitor%_#%t%_wndIds, %aWndId%`;,
|
2012-11-27 03:13:38 +00:00
|
|
|
Bar_updateView(Manager_aMonitor, t)
|
2012-12-05 12:39:51 +00:00
|
|
|
If (t = Monitor_#%Manager_aMonitor%_aView_#1)
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
|
|
|
Manager_winHide(aWndId)
|
|
|
|
Manager_hideShow := False
|
|
|
|
wndId := SubStr(View_#%Manager_aMonitor%_#%t%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%t%_wndIds, ";")-1)
|
|
|
|
Manager_winActivate(wndId)
|
2014-03-03 10:56:37 +00:00
|
|
|
If Config_dynamicTiling
|
|
|
|
View_arrange(Manager_aMonitor, t)
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
}
|
|
|
|
Else
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2012-11-27 03:13:38 +00:00
|
|
|
View_#%Manager_aMonitor%_#%t%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%t%_wndIds
|
|
|
|
View_#%Manager_aMonitor%_#%t%_aWndId := aWndId
|
|
|
|
Bar_updateView(Manager_aMonitor, t)
|
|
|
|
Manager_#%aWndId%_tags += 1 << t - 1
|
|
|
|
}
|
|
|
|
}
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|