2012-12-04 02:52:43 +00:00
|
|
|
/*
|
2016-03-09 18:34:57 +00:00
|
|
|
bug.n -- tiling window management
|
|
|
|
Copyright (c) 2010-2015 Joshua Fuhs, joten
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2016-03-09 18:34:57 +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.
|
|
|
|
|
|
|
|
@license GNU General Public License version 3
|
|
|
|
../LICENSE.md or <http://www.gnu.org/licenses/>
|
|
|
|
|
|
|
|
@version 9.0.0
|
2012-12-04 02:52:43 +00:00
|
|
|
*/
|
2011-07-27 17:43:34 +00:00
|
|
|
|
2015-01-31 00:45:36 +00:00
|
|
|
Monitor_init(m, doRestore) {
|
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
|
2015-01-31 00:45:36 +00:00
|
|
|
Monitor_#%m%_showTaskBar := Config_showTaskBar
|
|
|
|
Monitor_#%m%_taskBarClass := ""
|
2016-01-04 19:55:18 +00:00
|
|
|
Monitor_#%m%_taskBarPos := ""
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, % Config_viewCount
|
2012-11-27 03:13:38 +00:00
|
|
|
View_init(m, A_Index)
|
2012-12-05 23:55:38 +00:00
|
|
|
If doRestore
|
|
|
|
Config_restoreLayout(Main_autoLayout, m)
|
|
|
|
Else
|
|
|
|
Config_restoreLayout(Config_filePath, m)
|
2016-01-04 19:55:18 +00:00
|
|
|
SysGet, Monitor_#%m%_name, MonitorName, %m%
|
2012-11-27 03:13:38 +00:00
|
|
|
Monitor_getWorkArea(m)
|
|
|
|
Bar_init(m)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2015-01-28 16:42:18 +00:00
|
|
|
Monitor_activateView(i, d = 0) {
|
2016-04-08 19:11:19 +00:00
|
|
|
Local aMonitor, aView, aWndId, detectHidden, m, n, wndId, wndIds
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2016-04-08 19:11:19 +00:00
|
|
|
aMonitor := Manager_aMonitor
|
2015-01-28 16:42:18 +00:00
|
|
|
If (i = -1)
|
2016-04-08 19:11:19 +00:00
|
|
|
i := Monitor_#%aMonitor%_aView_#2
|
2015-01-28 16:42:18 +00:00
|
|
|
Else If (i = 0)
|
2016-04-08 19:11:19 +00:00
|
|
|
i := Monitor_#%aMonitor%_aView_#1
|
2015-01-28 16:42:18 +00:00
|
|
|
i := Manager_loop(i, d, 1, Config_viewCount)
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2016-04-08 19:11:19 +00:00
|
|
|
Debug_logMessage("DEBUG[1] Monitor_activateView; i: " . i . ", d: " . d . ", Manager_aMonitor: " . aMonitor . ", wndIds: " . View_#%Manager_aMonitor%_#%i%_wndIds, 1)
|
2015-01-28 16:42:18 +00:00
|
|
|
If (i <= 0) Or (i > Config_viewCount) Or Manager_hideShow
|
2012-11-27 03:13:38 +00:00
|
|
|
Return
|
2012-12-04 02:52:43 +00:00
|
|
|
;; Re-arrange the windows on the active view.
|
2016-04-08 19:11:19 +00:00
|
|
|
If (i = Monitor_#%aMonitor%_aView_#1) {
|
|
|
|
View_arrange(aMonitor, i)
|
2012-11-27 03:13:38 +00:00
|
|
|
Return
|
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2016-04-08 19:11:19 +00:00
|
|
|
aView := Monitor_#%aMonitor%_aView_#1
|
2015-03-06 20:28:09 +00:00
|
|
|
WinGet, aWndId, ID, A
|
2016-04-08 19:11:19 +00:00
|
|
|
If WinExist("ahk_id" aWndId) And InStr(View_#%aMonitor%_#%aView%_wndIds, aWndId ";") And Window_isProg(aWndId)
|
|
|
|
View_setActiveWindow(aMonitor, aView, 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
|
2015-01-28 16:42:18 +00:00
|
|
|
Loop, % n {
|
2012-11-27 03:13:38 +00:00
|
|
|
If (n = 1)
|
2016-04-08 19:11:19 +00:00
|
|
|
m := aMonitor
|
2012-11-27 03:13:38 +00:00
|
|
|
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
|
2015-01-28 16:42:18 +00:00
|
|
|
Monitor_#%m%_aView_#1 := i
|
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
|
|
|
{
|
2015-01-28 16:42:18 +00:00
|
|
|
If Not (Window_#%A_LoopField%_tags & (1 << i - 1))
|
2015-01-25 18:16:30 +00:00
|
|
|
Window_hide(A_LoopField)
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-11-27 03:13:38 +00:00
|
|
|
SetWinDelay, 10
|
2015-03-01 20:28:41 +00:00
|
|
|
detectHidden := A_DetectHiddenWindows
|
2012-11-27 03:13:38 +00:00
|
|
|
DetectHiddenWindows, On
|
2015-03-06 20:28:09 +00:00
|
|
|
wndId := View_getActiveWindow(m, i)
|
2015-03-01 20:09:54 +00:00
|
|
|
If wndId
|
|
|
|
Window_set(wndId, "AlwaysOnTop", "On")
|
2015-01-28 16:42:18 +00:00
|
|
|
View_arrange(m, i)
|
2015-03-01 20:28:41 +00:00
|
|
|
DetectHiddenWindows, %detectHidden%
|
2015-01-28 16:42:18 +00:00
|
|
|
StringTrimRight, wndIds, View_#%m%_#%i%_wndIds, 1
|
2012-11-27 03:13:38 +00:00
|
|
|
SetWinDelay, 0
|
2012-12-05 12:39:51 +00:00
|
|
|
Loop, PARSE, wndIds, `;
|
2012-12-04 02:52:43 +00:00
|
|
|
{
|
2015-01-25 18:38:10 +00:00
|
|
|
Window_show(A_LoopField)
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2015-03-01 20:09:54 +00:00
|
|
|
Window_set(wndId, "AlwaysOnTop", "Off")
|
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)
|
2015-01-28 16:42:18 +00:00
|
|
|
Bar_updateView(m, i)
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2016-04-08 19:11:19 +00:00
|
|
|
wndId := View_getActiveWindow(aMonitor, i)
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_winActivate(wndId)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2016-01-04 19:55:18 +00:00
|
|
|
Monitor_find(d, n) {
|
|
|
|
Local mName
|
|
|
|
|
|
|
|
If (d < 0 Or d > 0) {
|
|
|
|
Loop, % n {
|
|
|
|
SysGet, mName, MonitorName, %A_Index%
|
|
|
|
If Not (mName = Monitor_#%A_Index%_name)
|
|
|
|
Return, A_Index
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Return, 0
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2015-01-31 00:45:36 +00:00
|
|
|
Monitor_getWorkArea(m) {
|
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)
|
2015-01-31 00:45:36 +00:00
|
|
|
If wndId {
|
2012-11-27 03:13:38 +00:00
|
|
|
WinGetPos, wndX, wndY, wndWidth, wndHeight, ahk_id %wndId%
|
|
|
|
x := wndX + wndWidth / 2
|
|
|
|
y := wndY + wndHeight / 2
|
2015-01-31 00:45:36 +00:00
|
|
|
If (x >= monitorLeft && x <= monitorRight && y >= monitorTop && y <= monitorBottom) {
|
|
|
|
If (A_LoopField = "Shell_TrayWnd") Or (A_LoopField = "Shell_SecondaryTrayWnd")
|
|
|
|
Monitor_#%m%_taskBarClass := A_LoopField
|
|
|
|
|
|
|
|
If (wndHeight < wndWidth) {
|
|
|
|
;; Horizontal
|
|
|
|
If (wndY <= monitorTop) {
|
|
|
|
;; Top
|
2012-11-27 03:13:38 +00:00
|
|
|
wndHeight += wndY - monitorTop
|
|
|
|
monitorTop += wndHeight
|
2015-02-01 13:39:46 +00:00
|
|
|
If (A_LoopField = "Shell_TrayWnd") Or (A_LoopField = "Shell_SecondaryTrayWnd")
|
2016-01-04 19:55:18 +00:00
|
|
|
Monitor_#%m%_taskBarPos := "top"
|
2015-01-31 00:45:36 +00:00
|
|
|
} Else {
|
|
|
|
;; Bottom
|
2012-11-27 03:13:38 +00:00
|
|
|
wndHeight := monitorBottom - wndY
|
|
|
|
monitorBottom -= wndHeight
|
|
|
|
}
|
2015-01-31 00:45:36 +00:00
|
|
|
} Else {
|
|
|
|
;; Vertical
|
|
|
|
If (wndX <= monitorLeft) {
|
|
|
|
;; Left
|
2012-11-27 03:13:38 +00:00
|
|
|
wndWidth += wndX
|
|
|
|
monitorLeft += wndWidth
|
2015-01-31 00:45:36 +00:00
|
|
|
} Else {
|
|
|
|
;; 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
|
2015-01-31 00:45:36 +00:00
|
|
|
If Monitor_#%m%_showBar {
|
|
|
|
If (Config_verticalBarPos = "top") Or (Config_verticalBarPos = "tray") And Not Monitor_#%m%_taskBarClass {
|
2012-11-27 03:13:38 +00:00
|
|
|
bTop := monitorTop
|
2014-12-13 15:12:38 +00:00
|
|
|
monitorTop += bHeight
|
2015-01-31 00:45:36 +00:00
|
|
|
} Else If (Config_verticalBarPos = "bottom") {
|
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
|
2015-03-25 20:13:45 +00:00
|
|
|
|
|
|
|
Monitor_setWorkArea(monitorLeft, monitorTop, monitorRight, monitorBottom)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2016-01-04 19:55:18 +00:00
|
|
|
Monitor_moveToIndex(m, n) {
|
2012-11-27 03:13:38 +00:00
|
|
|
Global
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2016-01-04 19:55:18 +00:00
|
|
|
Monitor_#%n%_aView_#1 := Monitor_#%m%_aView_#1
|
|
|
|
Monitor_#%n%_aView_#2 := Monitor_#%m%_aView_#2
|
|
|
|
Monitor_#%n%_name := Monitor_#%m%_name
|
|
|
|
Monitor_#%n%_showBar := Monitor_#%m%_showBar
|
|
|
|
Monitor_#%n%_showTaskBar := Monitor_#%m%_showTaskBar
|
|
|
|
Monitor_#%n%_taskBarClass := Monitor_#%m%_taskBarClass
|
|
|
|
Monitor_#%n%_taskBarPos := Monitor_#%m%_taskBarPos
|
|
|
|
Monitor_#%n%_height := Monitor_#%m%_height
|
|
|
|
Monitor_#%n%_width := Monitor_#%m%_width
|
|
|
|
Monitor_#%n%_x := Monitor_#%m%_x
|
|
|
|
Monitor_#%n%_y := Monitor_#%m%_y
|
|
|
|
Monitor_#%n%_barY := Monitor_#%m%_barY
|
|
|
|
Loop, % Config_viewCount
|
|
|
|
View_moveToIndex(m, A_Index, n, A_Index)
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2015-01-28 17:11:47 +00:00
|
|
|
Monitor_setWindowTag(i, d = 0) {
|
2012-11-27 03:13:38 +00:00
|
|
|
Local aView, aWndId, wndId
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2015-01-28 17:11:47 +00:00
|
|
|
If (i = 0)
|
|
|
|
i := Monitor_#%Manager_aMonitor%_aView_#1
|
|
|
|
Else If (i <= Config_viewCount)
|
|
|
|
i := Manager_loop(i, d, 1, Config_viewCount)
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
WinGet, aWndId, ID, A
|
2015-01-28 17:11:47 +00:00
|
|
|
If InStr(Manager_managedWndIds, aWndId ";") And (i > 0) And (i <= Config_viewCount Or i = 10) {
|
|
|
|
If (i = 10) {
|
|
|
|
Loop, % Config_viewCount {
|
|
|
|
If Not (Window_#%aWndId%_tags & (1 << A_Index - 1)) {
|
2012-11-27 03:13:38 +00:00
|
|
|
View_#%Manager_aMonitor%_#%A_Index%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%A_Index%_wndIds
|
2015-03-06 20:28:09 +00:00
|
|
|
View_setActiveWindow(Manager_aMonitor, A_Index, aWndId)
|
2012-11-27 03:13:38 +00:00
|
|
|
Bar_updateView(Manager_aMonitor, A_Index)
|
2015-01-25 18:38:10 +00:00
|
|
|
Window_#%aWndId%_tags += 1 << A_Index - 1
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2015-01-28 17:11:47 +00:00
|
|
|
} Else {
|
|
|
|
Loop, % Config_viewCount {
|
|
|
|
If Not (A_index = i) {
|
2012-12-05 12:39:51 +00:00
|
|
|
StringReplace, View_#%Manager_aMonitor%_#%A_Index%_wndIds, View_#%Manager_aMonitor%_#%A_Index%_wndIds, %aWndId%`;,
|
2015-03-06 20:28:09 +00:00
|
|
|
View_setActiveWindow(Manager_aMonitor, A_Index, 0)
|
2012-11-27 03:13:38 +00:00
|
|
|
Bar_updateView(Manager_aMonitor, A_Index)
|
|
|
|
}
|
2012-12-04 02:52:43 +00:00
|
|
|
}
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2015-01-28 17:11:47 +00:00
|
|
|
If Not (Window_#%aWndId%_tags & (1 << i - 1))
|
|
|
|
View_#%Manager_aMonitor%_#%i%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%i%_wndIds
|
2015-03-06 20:28:09 +00:00
|
|
|
View_setActiveWindow(Manager_aMonitor, i, aWndId)
|
2015-01-28 17:11:47 +00:00
|
|
|
Window_#%aWndId%_tags := 1 << i - 1
|
2012-12-05 12:39:51 +00:00
|
|
|
|
2012-11-27 03:13:38 +00:00
|
|
|
aView := Monitor_#%Manager_aMonitor%_aView_#1
|
2015-01-28 17:11:47 +00:00
|
|
|
If Not (i = aView) {
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
2015-01-28 17:11:47 +00:00
|
|
|
wndId := SubStr(View_#%Manager_aMonitor%_#%aView%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%aView%_wndIds, ";") - 1)
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_winActivate(wndId)
|
|
|
|
Manager_hideShow := False
|
|
|
|
If Config_viewFollowsTagged
|
2015-01-28 17:11:47 +00:00
|
|
|
Monitor_activateView(i)
|
|
|
|
Else {
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
2015-01-25 18:16:30 +00:00
|
|
|
Window_hide(aWndId)
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := False
|
2014-03-03 10:56:37 +00:00
|
|
|
If Config_dynamicTiling
|
|
|
|
View_arrange(Manager_aMonitor, aView)
|
2015-01-28 17:11:47 +00:00
|
|
|
Bar_updateView(Manager_aMonitor, i)
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2015-03-25 20:13:45 +00:00
|
|
|
Monitor_setWorkArea(left, top, right, bottom) {
|
|
|
|
VarSetCapacity(area, 16)
|
|
|
|
NumPut(left, area, 0)
|
|
|
|
NumPut(top, area, 4)
|
|
|
|
NumPut(right, area, 8)
|
|
|
|
NumPut(bottom, area, 12)
|
|
|
|
DllCall("SystemParametersInfo", UInt, 0x2F, UInt, 0, UInt, &area, UInt, 0) ; 0x2F = SPI_SETWORKAREA
|
|
|
|
}
|
2015-07-09 19:59:52 +00:00
|
|
|
;; flashkid: Send SetWorkArea to second Monitor (http://www.autohotkey.com/board/topic/42564-send-setworkarea-to-second-monitor/)
|
2015-03-25 20:13:45 +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
|
|
|
}
|
|
|
|
|
2015-03-01 20:28:41 +00:00
|
|
|
Monitor_toggleNotifyIconOverflowWindow() {
|
2013-03-25 21:30:12 +00:00
|
|
|
Static wndId
|
|
|
|
|
2015-03-01 20:28:41 +00:00
|
|
|
If Not WinExist("ahk_class NotifyIconOverflowWindow") {
|
2013-03-25 21:30:12 +00:00
|
|
|
WinGet, wndId, ID, A
|
2015-03-01 20:28:41 +00:00
|
|
|
detectHidden := A_DetectHiddenWindows
|
2013-03-25 21:30:12 +00:00
|
|
|
DetectHiddenWindows, On
|
|
|
|
WinShow, ahk_class NotifyIconOverflowWindow
|
|
|
|
WinActivate, ahk_class NotifyIconOverflowWindow
|
2015-03-01 20:28:41 +00:00
|
|
|
DetectHiddenWindows, %detectHidden%
|
|
|
|
} Else {
|
2013-03-25 21:30:12 +00:00
|
|
|
WinHide, ahk_class NotifyIconOverflowWindow
|
|
|
|
WinActivate, ahk_id %wndId%
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-31 00:45:36 +00:00
|
|
|
Monitor_toggleTaskBar() {
|
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
|
2015-01-31 00:45:36 +00:00
|
|
|
If Monitor_#%m%_taskBarClass {
|
|
|
|
Monitor_#%m%_showTaskBar := Not Monitor_#%m%_showTaskBar
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
2015-01-31 00:45:36 +00:00
|
|
|
If Not Monitor_#%m%_showTaskBar {
|
2012-11-27 03:13:38 +00:00
|
|
|
WinHide, Start ahk_class Button
|
2015-01-31 00:45:36 +00:00
|
|
|
WinHide, % "ahk_class " Monitor_#%m%_taskBarClass
|
|
|
|
} Else {
|
2012-11-27 03:13:38 +00:00
|
|
|
WinShow, Start ahk_class Button
|
2015-01-31 00:45:36 +00:00
|
|
|
WinShow, % "ahk_class " Monitor_#%m%_taskBarClass
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
|
|
|
Manager_hideShow := False
|
|
|
|
Monitor_getWorkArea(m)
|
|
|
|
Bar_move(m)
|
|
|
|
View_arrange(m, Monitor_#%m%_aView_#1)
|
|
|
|
}
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|
|
|
|
|
2015-01-28 18:42:07 +00:00
|
|
|
Monitor_toggleWindowTag(i, d = 0) {
|
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
|
2015-01-28 18:42:07 +00:00
|
|
|
If (InStr(Manager_managedWndIds, aWndId ";") And i >= 0 And i <= Config_viewCount) {
|
|
|
|
If (Window_#%aWndId%_tags & (1 << i - 1)) {
|
|
|
|
If Not ((Window_#%aWndId%_tags - (1 << i - 1)) = 0) {
|
|
|
|
Window_#%aWndId%_tags -= 1 << i - 1
|
|
|
|
StringReplace, View_#%Manager_aMonitor%_#%i%_wndIds, View_#%Manager_aMonitor%_#%i%_wndIds, %aWndId%`;,
|
|
|
|
Bar_updateView(Manager_aMonitor, i)
|
|
|
|
If (i = Monitor_#%Manager_aMonitor%_aView_#1) {
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := True
|
2015-01-25 18:16:30 +00:00
|
|
|
Window_hide(aWndId)
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_hideShow := False
|
2015-01-28 18:42:07 +00:00
|
|
|
wndId := SubStr(View_#%Manager_aMonitor%_#%i%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%i%_wndIds, ";")-1)
|
2012-11-27 03:13:38 +00:00
|
|
|
Manager_winActivate(wndId)
|
2014-03-03 10:56:37 +00:00
|
|
|
If Config_dynamicTiling
|
2015-01-28 18:42:07 +00:00
|
|
|
View_arrange(Manager_aMonitor, i)
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
|
|
|
}
|
2015-01-28 18:42:07 +00:00
|
|
|
} Else {
|
|
|
|
View_#%Manager_aMonitor%_#%i%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%i%_wndIds
|
2015-03-06 20:28:09 +00:00
|
|
|
View_setActiveWindow(Manager_aMonitor, i, aWndId)
|
2015-01-28 18:42:07 +00:00
|
|
|
Bar_updateView(Manager_aMonitor, i)
|
|
|
|
Window_#%aWndId%_tags += 1 << i - 1
|
2012-11-27 03:13:38 +00:00
|
|
|
}
|
|
|
|
}
|
2011-07-27 17:43:34 +00:00
|
|
|
}
|