re-written and moved Log.ahk to Debug.ahk (to be extended)
This commit is contained in:
parent
aa7ddae698
commit
590017c0b0
8 changed files with 119 additions and 59 deletions
|
@ -1,4 +1,4 @@
|
||||||
syntax: glob
|
syntax: glob
|
||||||
src/Config.ini
|
|
||||||
src/Config_test.ini
|
|
||||||
01_administration.org
|
01_administration.org
|
||||||
|
syntax: regexp
|
||||||
|
.*[cC]onfig.*\.ini
|
||||||
|
|
12
src/Bar.ahk
12
src/Bar.ahk
|
@ -38,7 +38,7 @@ Bar_init(m) {
|
||||||
; Create the GUI window
|
; Create the GUI window
|
||||||
wndTitle := "bug.n_BAR_" m
|
wndTitle := "bug.n_BAR_" m
|
||||||
GuiN := (m - 1) + 1
|
GuiN := (m - 1) + 1
|
||||||
Log_dbg_msg(6, "Bar_init(): Gui, " . GuiN . ": Default")
|
Debug_logMessage("DEBUG[6] Bar_init(): Gui, " . GuiN . ": Default", 6)
|
||||||
Gui, %GuiN%: Default
|
Gui, %GuiN%: Default
|
||||||
IfWinExist, %wndTitle%
|
IfWinExist, %wndTitle%
|
||||||
Gui, Destroy
|
Gui, Destroy
|
||||||
|
@ -364,9 +364,9 @@ Bar_evaluateCommand() {
|
||||||
Manager_activateMonitor(-1)
|
Manager_activateMonitor(-1)
|
||||||
} Else If (Bar_command_#2 = "Log") {
|
} Else If (Bar_command_#2 = "Log") {
|
||||||
If (Bar_command_#1 = "increment debug level")
|
If (Bar_command_#1 = "increment debug level")
|
||||||
Log_incDebugLevel()
|
Debug_setLogLevel(+1)
|
||||||
If (Bar_command_#1 = "decrement debug level")
|
If (Bar_command_#1 = "decrement debug level")
|
||||||
Log_decDebugLevel()
|
Debug_setLogLevel(-1)
|
||||||
If (Bar_command_#1 = "log help info")
|
If (Bar_command_#1 = "log help info")
|
||||||
Manager_logHelp()
|
Manager_logHelp()
|
||||||
If (Bar_command_#1 = "log view window info")
|
If (Bar_command_#1 = "log view window info")
|
||||||
|
@ -652,7 +652,7 @@ Bar_updateStatus() {
|
||||||
Loop, % Manager_monitorCount {
|
Loop, % Manager_monitorCount {
|
||||||
m := A_Index
|
m := A_Index
|
||||||
GuiN := (m - 1) + 1
|
GuiN := (m - 1) + 1
|
||||||
Log_dbg_msg(6, "Bar_updateStatus(): Gui, " . GuiN . ": Default")
|
Debug_logMessage("DEBUG[6] Bar_updateStatus(): Gui, " . GuiN . ": Default", 6)
|
||||||
Gui, %GuiN%: Default
|
Gui, %GuiN%: Default
|
||||||
If Config_readinBat {
|
If Config_readinBat {
|
||||||
Bar_getBatteryStatus(b1, b2)
|
Bar_getBatteryStatus(b1, b2)
|
||||||
|
@ -711,7 +711,7 @@ Bar_updateTitle(debugMsg = "") {
|
||||||
i := Config_viewCount + 2
|
i := Config_viewCount + 2
|
||||||
Loop, % Manager_monitorCount {
|
Loop, % Manager_monitorCount {
|
||||||
GuiN := (A_Index - 1) + 1
|
GuiN := (A_Index - 1) + 1
|
||||||
Log_dbg_msg(6, "Bar_updateTitle(): Gui, " . GuiN . ": Default")
|
Debug_logMessage("DEBUG[6] Bar_updateTitle(): Gui, " . GuiN . ": Default", 6)
|
||||||
Gui, %GuiN%: Default
|
Gui, %GuiN%: Default
|
||||||
GuiControlGet, content, , Bar_#%A_Index%_#%i%
|
GuiControlGet, content, , Bar_#%A_Index%_#%i%
|
||||||
If (A_Index = Manager_aMonitor) {
|
If (A_Index = Manager_aMonitor) {
|
||||||
|
@ -728,7 +728,7 @@ Bar_updateView(m, v) {
|
||||||
Local IdsLen, ViewIdsLen
|
Local IdsLen, ViewIdsLen
|
||||||
|
|
||||||
GuiN := (m - 1) + 1
|
GuiN := (m - 1) + 1
|
||||||
Log_dbg_msg(6, "Bar_updateView(): m: " . m . "; Gui, " . GuiN . ": Default")
|
Debug_logMessage("DEBUG[6] Bar_updateView(): m: " . m . "; Gui, " . GuiN . ": Default", 6)
|
||||||
Gui, %GuiN%: Default
|
Gui, %GuiN%: Default
|
||||||
|
|
||||||
IdsLen := StrLen(Manager_managedWndIds)
|
IdsLen := StrLen(Manager_managedWndIds)
|
||||||
|
|
|
@ -398,8 +398,8 @@ Config_saveSession() {
|
||||||
#^i::Manager_logViewWindowList() ; Dump window information for the active view.
|
#^i::Manager_logViewWindowList() ; Dump window information for the active view.
|
||||||
#+^i::Manager_logManagedWindowList() ; Dump window information for every managed window.
|
#+^i::Manager_logManagedWindowList() ; Dump window information for every managed window.
|
||||||
#^h::Manager_logHelp() ; Dump to the log an explanation of some of the other more cryptic log messages.
|
#^h::Manager_logHelp() ; Dump to the log an explanation of some of the other more cryptic log messages.
|
||||||
#^[::Log_decDebugLevel() ; Decrement the log debug level.
|
#^l::Debug_setLogLevel(-1) ; Decrement the log debug level.
|
||||||
#^]::Log_incDebugLevel() ; Increment the log debug level.
|
#^+l::Debug_setLogLevel(+1) ; Increment the log debug level.
|
||||||
|
|
||||||
#Tab::View_setLayout(-1) ; Set the previously set layout. You may also use View_setLayout(">") for setting the next layout in the layout array.
|
#Tab::View_setLayout(-1) ; Set the previously set layout. You may also use View_setLayout(">") for setting the next layout in the layout array.
|
||||||
#f::View_setLayout(3) ; Set the 3rd defined layout (i. e. floating layout in the default configuration).
|
#f::View_setLayout(3) ; Set the 3rd defined layout (i. e. floating layout in the default configuration).
|
||||||
|
|
63
src/Debug.ahk
Normal file
63
src/Debug.ahk
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
bug.n -- tiling window management
|
||||||
|
Copyright (c) 2010-2012 Joshua Fuhs, joten
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
@version 8.3.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
Debug_initLog(filename, level = 0, truncateFile = True)
|
||||||
|
{
|
||||||
|
Global Debug_logFilename, Debug_logLevel
|
||||||
|
|
||||||
|
Debug_logFilename := filename
|
||||||
|
Debug_logLevel := level
|
||||||
|
If truncateFile
|
||||||
|
If FileExist(Debug_logFilename)
|
||||||
|
FileDelete, %Debug_logFilename%
|
||||||
|
Debug_logMessage("Log initialized.", 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug_logMessage(text, level = 1, includeTimestamp = True)
|
||||||
|
{
|
||||||
|
Global Debug_logFilename, Debug_logLevel
|
||||||
|
|
||||||
|
If Debug_logLevel >= level
|
||||||
|
{
|
||||||
|
If includeTimestamp
|
||||||
|
{
|
||||||
|
FormatTime, time, , yyyy-MM-dd HH:mm:ss
|
||||||
|
text := time " " text
|
||||||
|
}
|
||||||
|
Else
|
||||||
|
text := " " text
|
||||||
|
FileAppend, %text%`r`n, %Debug_logFilename%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug_setLogLevel(d)
|
||||||
|
{
|
||||||
|
Global Debug_logLevel
|
||||||
|
|
||||||
|
i := Debug_logLevel + d
|
||||||
|
If i >= 0
|
||||||
|
{
|
||||||
|
Debug_logLevel := i
|
||||||
|
If i = 0
|
||||||
|
Debug_logMessage("Logging disabled.")
|
||||||
|
Else
|
||||||
|
Debug_logMessage("Log level set to " i ".")
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,8 +36,7 @@ SetWinDelay, 10
|
||||||
Main_dataDir = %1%
|
Main_dataDir = %1%
|
||||||
Else
|
Else
|
||||||
Main_dataDir = %A_ScriptDir% ;; %A_ScriptDir% is the directory, in which 'Main.ahk' or the executable of bug.n is saved.
|
Main_dataDir = %A_ScriptDir% ;; %A_ScriptDir% is the directory, in which 'Main.ahk' or the executable of bug.n is saved.
|
||||||
Log_init(Main_dataDir "\log.txt", False)
|
Debug_initLog(Main_dataDir "\log.txt", 0, False)
|
||||||
Log_msg("====== Initializing ======")
|
|
||||||
Config_filePath := Main_dataDir "\config.ini"
|
Config_filePath := Main_dataDir "\config.ini"
|
||||||
Config_init()
|
Config_init()
|
||||||
|
|
||||||
|
@ -57,11 +56,12 @@ Return ; end of the auto-execute section
|
||||||
* function & label definitions
|
* function & label definitions
|
||||||
*/
|
*/
|
||||||
Main_cleanup: ; The labels with "ExitApp" or "Return" at the end and hotkeys have to be after the auto-execute section.
|
Main_cleanup: ; The labels with "ExitApp" or "Return" at the end and hotkeys have to be after the auto-execute section.
|
||||||
Log_msg("====== Cleaning up ======")
|
Debug_logMessage("Cleaning up", 0)
|
||||||
If Config_autoSaveSession
|
If Config_autoSaveSession
|
||||||
Config_saveSession()
|
Config_saveSession()
|
||||||
Manager_cleanup()
|
Manager_cleanup()
|
||||||
DllCall("CloseHandle", "UInt", Bar_hDrive) ; used in Bar_getDiskLoad
|
DllCall("CloseHandle", "UInt", Bar_hDrive) ; used in Bar_getDiskLoad
|
||||||
|
Debug_logMessage("Exiting bug.n", 0)
|
||||||
ExitApp
|
ExitApp
|
||||||
|
|
||||||
Main_help:
|
Main_help:
|
||||||
|
@ -135,9 +135,9 @@ Main_toggleBar:
|
||||||
Monitor_toggleBar()
|
Monitor_toggleBar()
|
||||||
Return
|
Return
|
||||||
|
|
||||||
#Include Log.ahk
|
|
||||||
#Include Bar.ahk
|
#Include Bar.ahk
|
||||||
#Include Config.ahk
|
#Include Config.ahk
|
||||||
|
#Include Debug.ahk
|
||||||
#Include Manager.ahk
|
#Include Manager.ahk
|
||||||
#Include Monitor.ahk
|
#Include Monitor.ahk
|
||||||
#Include View.ahk
|
#Include View.ahk
|
||||||
|
|
|
@ -283,18 +283,18 @@ Manager_logWindowInfo( w ) {
|
||||||
isResponsive := "*"
|
isResponsive := "*"
|
||||||
|
|
||||||
|
|
||||||
Log_bare(w . "`t" . isHidden . " " isWinFocus . " " . isBugnActive . " " . isFloating . " " . isDecorated . " " . isResponsive . " " . isGhost . " " . Manager_#%w%_monitor . "`t" . Manager_#%w%_tags . "`t" . wndX . "`t" . wndY . "`t" . wndW . "`t" . wndH . "`t" . wndStyle . "`t" . wndProc . " / " . wndClass . " / " . wndTitle)
|
Debug_logMessage(w . "`t" . isHidden . " " isWinFocus . " " . isBugnActive . " " . isFloating . " " . isDecorated . " " . isResponsive . " " . isGhost . " " . Manager_#%w%_monitor . "`t" . Manager_#%w%_tags . "`t" . wndX . "`t" . wndY . "`t" . wndW . "`t" . wndH . "`t" . wndStyle . "`t" . wndProc . " / " . wndClass . " / " . wndTitle, 0, False)
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager_logHeader() {
|
Manager_logHeader() {
|
||||||
Log_bare( "ID`t`tH W A F D R G M`tTags`tX`tY`tW`tH`tStyle`t`tProc / Class / Title")
|
Debug_logMessage( "ID`t`tH W A F D R G M`tTags`tX`tY`tW`tH`tStyle`t`tProc / Class / Title", 0, False)
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager_logViewWindowList() {
|
Manager_logViewWindowList() {
|
||||||
Local text, v, aWndId, wndIds, aWndTitle
|
Local text, v, aWndId, wndIds, aWndTitle
|
||||||
|
|
||||||
v := Monitor_#%Manager_aMonitor%_aView_#1
|
v := Monitor_#%Manager_aMonitor%_aView_#1
|
||||||
Log_msg( "Window dump for active view (" . Manager_aMonitor . ", " . v . ")" )
|
Debug_logMessage( "Window dump for active view (" . Manager_aMonitor . ", " . v . ")" )
|
||||||
Manager_logHeader()
|
Manager_logHeader()
|
||||||
|
|
||||||
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%v%_wndIds, 1
|
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%v%_wndIds, 1
|
||||||
|
@ -307,7 +307,7 @@ Manager_logViewWindowList() {
|
||||||
Manager_logManagedWindowList() {
|
Manager_logManagedWindowList() {
|
||||||
Local wndIds
|
Local wndIds
|
||||||
|
|
||||||
Log_msg( "Window dump for manager" )
|
Debug_logMessage( "Window dump for manager" )
|
||||||
Manager_logHeader()
|
Manager_logHeader()
|
||||||
|
|
||||||
StringTrimRight, wndIds, Manager_managedWndIds, 1
|
StringTrimRight, wndIds, Manager_managedWndIds, 1
|
||||||
|
@ -318,24 +318,24 @@ Manager_logManagedWindowList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager_logHelp() {
|
Manager_logHelp() {
|
||||||
Log_msg("Help Display")
|
Debug_logMessage("Help Display")
|
||||||
Log_bare("Window list columns")
|
Debug_logMessage("Window list columns", 0)
|
||||||
Log_bare(" ID - Windows ID. Unique, OS-assigned ID")
|
Debug_logMessage(" ID - Windows ID. Unique, OS-assigned ID", 0)
|
||||||
Log_bare(" H - Hidden. Whether bug.n thinks this window is hidden.")
|
Debug_logMessage(" H - Hidden. Whether bug.n thinks this window is hidden.", 0)
|
||||||
Log_bare(" W - Windows active. This window is active according to Windows.")
|
Debug_logMessage(" W - Windows active. This window is active according to Windows.", 0)
|
||||||
Log_bare(" A - View active. This window is active according to bug.n.")
|
Debug_logMessage(" A - View active. This window is active according to bug.n.", 0)
|
||||||
Log_bare(" F - Floating. This window should not be positioned and resized by the layout.")
|
Debug_logMessage(" F - Floating. This window should not be positioned and resized by the layout.", 0)
|
||||||
Log_bare(" D - Decorated. Does the window have a title bar?")
|
Debug_logMessage(" D - Decorated. Does the window have a title bar?", 0)
|
||||||
Log_bare(" R - Responsive. Is responding to messages?")
|
Debug_logMessage(" R - Responsive. Is responding to messages?", 0)
|
||||||
Log_bare(" G - Ghost. Is this window a ghost of another hung window?")
|
Debug_logMessage(" G - Ghost. Is this window a ghost of another hung window?", 0)
|
||||||
Log_bare(" M - Monitor number.")
|
Debug_logMessage(" M - Monitor number.", 0)
|
||||||
Log_bare(" Tags - Bit-mask of the views in which the window is active.")
|
Debug_logMessage(" Tags - Bit-mask of the views in which the window is active.", 0)
|
||||||
Log_bare(" X - Windows X position.")
|
Debug_logMessage(" X - Windows X position.", 0)
|
||||||
Log_bare(" Y - Windows Y position.")
|
Debug_logMessage(" Y - Windows Y position.", 0)
|
||||||
Log_bare(" W - Windows width.")
|
Debug_logMessage(" W - Windows width.", 0)
|
||||||
Log_bare(" H - Windows height.")
|
Debug_logMessage(" H - Windows height.", 0)
|
||||||
Log_bare(" Style - Windows style.")
|
Debug_logMessage(" Style - Windows style.", 0)
|
||||||
Log_bare(" Proc / Class / Title - Process/Class/Title of the window.")
|
Debug_logMessage(" Proc / Class / Title - Process/Class/Title of the window.", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager_lockWorkStation() {
|
Manager_lockWorkStation() {
|
||||||
|
@ -375,7 +375,7 @@ Manager_manage(pm, pv, wndId) {
|
||||||
|
|
||||||
body := 0
|
body := 0
|
||||||
If Manager_isGhost( wndId ) {
|
If Manager_isGhost( wndId ) {
|
||||||
Log_dbg_msg(2, "A window has given up the ghost (Ghost wndId: " . wndId . ")")
|
Debug_logMessage("DEBUG[2] A window has given up the ghost (Ghost wndId: " . wndId . ")", 2)
|
||||||
; Ghosts need special attention.
|
; Ghosts need special attention.
|
||||||
; Say a quick prayer and try to reattach it to its body.
|
; Say a quick prayer and try to reattach it to its body.
|
||||||
body := Manager_findHung( wndId )
|
body := Manager_findHung( wndId )
|
||||||
|
@ -388,7 +388,7 @@ Manager_manage(pm, pv, wndId) {
|
||||||
hideTitle := InStr(Bar_hideTitleWndIds, body ";")
|
hideTitle := InStr(Bar_hideTitleWndIds, body ";")
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
Log_dbg_msg(1, "No body could be found for ghost wndId: " . wndId)
|
Debug_logMessage("DEBUG[1] No body could be found for ghost wndId: " . wndId, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -532,7 +532,7 @@ Manager_onShellMessage(wParam, lParam) {
|
||||||
lParam := lParam+0
|
lParam := lParam+0
|
||||||
SetFormat, Integer, d
|
SetFormat, Integer, d
|
||||||
|
|
||||||
Log_dbg_msg(2, "Manager_onShellMessage( wParam: " . wParam . ", lParam: " . lParam . " )")
|
Debug_logMessage("DEBUG[2] Manager_onShellMessage( wParam: " . wParam . ", lParam: " . lParam . " )", 2)
|
||||||
|
|
||||||
WinGetClass, wndClass, ahk_id %lParam%
|
WinGetClass, wndClass, ahk_id %lParam%
|
||||||
WinGetTitle, wndTitle, ahk_id %lParam%
|
WinGetTitle, wndTitle, ahk_id %lParam%
|
||||||
|
@ -590,7 +590,7 @@ Manager_onShellMessage(wParam, lParam) {
|
||||||
wndId := SubStr(wndIds, 1, InStr(wndIds, ";") - 1)
|
wndId := SubStr(wndIds, 1, InStr(wndIds, ";") - 1)
|
||||||
Loop, % Config_viewCount
|
Loop, % Config_viewCount
|
||||||
If (Manager_#%wndId%_tags & 1 << A_Index - 1) {
|
If (Manager_#%wndId%_tags & 1 << A_Index - 1) {
|
||||||
Log_dbg_msg(3, "Switching views because " . wndId . " is considered hidden and active")
|
Debug_logMessage("DEBUG[3] Switching views because " . wndId . " is considered hidden and active", 3)
|
||||||
Manager_aMonitor := Manager_#%wndId%_monitor
|
Manager_aMonitor := Manager_#%wndId%_monitor
|
||||||
Monitor_activateView(A_Index)
|
Monitor_activateView(A_Index)
|
||||||
Break
|
Break
|
||||||
|
@ -825,7 +825,7 @@ Manager_winActivate(wndId) {
|
||||||
DllCall("SetCursorPos", "Int", Round(Monitor_#%Manager_aMonitor%_x + Monitor_#%Manager_aMonitor%_width / 2), "Int", Round(Monitor_#%Manager_aMonitor%_y + Monitor_#%Manager_aMonitor%_height / 2))
|
DllCall("SetCursorPos", "Int", Round(Monitor_#%Manager_aMonitor%_x + Monitor_#%Manager_aMonitor%_width / 2), "Int", Round(Monitor_#%Manager_aMonitor%_y + Monitor_#%Manager_aMonitor%_height / 2))
|
||||||
}
|
}
|
||||||
If Manager_isHung(wndId) {
|
If Manager_isHung(wndId) {
|
||||||
Log_dbg_msg(2, "Manager_winActivate: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winActivate: Potentially hung window " . wndId, 2)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
|
@ -840,7 +840,7 @@ Manager_winActivate(wndId) {
|
||||||
|
|
||||||
Manager_winMove(wndId, x, y, width, height) {
|
Manager_winMove(wndId, x, y, width, height) {
|
||||||
If Manager_isHung(wndId) {
|
If Manager_isHung(wndId) {
|
||||||
Log_dbg_msg(2, "Manager_winMove: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winMove: Potentially hung window " . wndId, 2)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
|
@ -849,7 +849,7 @@ Manager_winMove(wndId, x, y, width, height) {
|
||||||
WM_EXITSIZEMOVE = 0x0232
|
WM_EXITSIZEMOVE = 0x0232
|
||||||
SendMessage, WM_ENTERSIZEMOVE, , , , ahk_id %wndId%
|
SendMessage, WM_ENTERSIZEMOVE, , , , ahk_id %wndId%
|
||||||
If ErrorLevel {
|
If ErrorLevel {
|
||||||
Log_dbg_msg(2, "Manager_winMove: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winMove: Potentially hung window " . wndId, 1)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
|
@ -860,7 +860,7 @@ Manager_winMove(wndId, x, y, width, height) {
|
||||||
|
|
||||||
Manager_winHide(wndId) {
|
Manager_winHide(wndId) {
|
||||||
If Manager_isHung(wndId) {
|
If Manager_isHung(wndId) {
|
||||||
Log_dbg_msg(2, "Manager_winHide: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winHide: Potentially hung window " . wndId, 2)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
|
@ -871,7 +871,7 @@ Manager_winHide(wndId) {
|
||||||
|
|
||||||
Manager_winShow(wndId) {
|
Manager_winShow(wndId) {
|
||||||
If Manager_isHung(wndId) {
|
If Manager_isHung(wndId) {
|
||||||
Log_dbg_msg(2, "Manager_winShow: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winShow: Potentially hung window " . wndId, 2)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
|
@ -882,7 +882,7 @@ Manager_winShow(wndId) {
|
||||||
|
|
||||||
Manager_winClose(wndId) {
|
Manager_winClose(wndId) {
|
||||||
If Manager_isHung(wndId) {
|
If Manager_isHung(wndId) {
|
||||||
Log_dbg_msg(2, "Manager_winClose: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winClose: Potentially hung window " . wndId, 2)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
|
@ -893,7 +893,7 @@ Manager_winClose(wndId) {
|
||||||
|
|
||||||
Manager_winSet(type, value, wndId) {
|
Manager_winSet(type, value, wndId) {
|
||||||
If Manager_isHung(wndId) {
|
If Manager_isHung(wndId) {
|
||||||
Log_dbg_msg(2, "Manager_winSet: Potentially hung window " . wndId)
|
Debug_logMessage("DEBUG[2] Manager_winSet: Potentially hung window " . wndId, 2)
|
||||||
Return 1
|
Return 1
|
||||||
}
|
}
|
||||||
Else {
|
Else {
|
||||||
|
@ -923,7 +923,6 @@ Manager_isHung(wndId) {
|
||||||
; This is only known to work on Windows 7
|
; This is only known to work on Windows 7
|
||||||
Manager_findHung( ghostWnd ) {
|
Manager_findHung( ghostWnd ) {
|
||||||
Local expectedTitle, expectedX, expectedY, expectedW, expectedH, wndTitle, wndX, wndY, wndW, wndH, wndIds
|
Local expectedTitle, expectedX, expectedY, expectedW, expectedH, wndTitle, wndX, wndY, wndW, wndH, wndIds
|
||||||
;Log_dbg_msg(3, "Manager_findHung(" . ghostWnd . ")")
|
|
||||||
WinGetTitle, expectedTitle, ahk_id %ghostWnd%
|
WinGetTitle, expectedTitle, ahk_id %ghostWnd%
|
||||||
StringReplace, expectedTitle, expectedTitle, " (Not Responding)", ""
|
StringReplace, expectedTitle, expectedTitle, " (Not Responding)", ""
|
||||||
WinGetPos, expectedX, expectedY, expectedW, expectedH, ahk_id %ghostWnd%
|
WinGetPos, expectedX, expectedY, expectedW, expectedH, ahk_id %ghostWnd%
|
||||||
|
|
|
@ -41,7 +41,7 @@ Monitor_activateView(v) {
|
||||||
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)
|
||||||
|
|
||||||
Log_dbg_msg(1, "Monitor_activateView(" . v . ") Manager_aMonitor: " . Manager_aMonitor . "; wndIds: " . View_#%m%_#%aView%_wndIds)
|
Debug_logMessage("DEBUG[1] Monitor_activateView(" . v . ") Manager_aMonitor: " . Manager_aMonitor . "; wndIds: " . View_#%m%_#%aView%_wndIds, 1)
|
||||||
|
|
||||||
If (v <= 0) Or (v > Config_viewCount) Or Manager_hideShow
|
If (v <= 0) Or (v > Config_viewCount) Or Manager_hideShow
|
||||||
Return
|
Return
|
||||||
|
|
18
src/View.ahk
18
src/View.ahk
|
@ -38,18 +38,18 @@ View_init(m, v) {
|
||||||
View_activateWindow(d) {
|
View_activateWindow(d) {
|
||||||
Local aWndId, i, j, v, wndId, wndId0, wndIds, failure, direction
|
Local aWndId, i, j, v, wndId, wndId0, wndIds, failure, direction
|
||||||
|
|
||||||
Log_dbg_msg(1, "View_activateWindow(" . d . ")")
|
Debug_logMessage("DEBUG[1] View_activateWindow(" . d . ")", 1)
|
||||||
|
|
||||||
If (d = 0)
|
If (d = 0)
|
||||||
Return
|
Return
|
||||||
|
|
||||||
WinGet, aWndId, ID, A
|
WinGet, aWndId, ID, A
|
||||||
Log_dbg_bare(2, "Active Windows ID: " . aWndId)
|
Debug_logMessage("DEBUG[2] Active Windows ID: " . aWndId, 2, False)
|
||||||
v := Monitor_#%Manager_aMonitor%_aView_#1
|
v := Monitor_#%Manager_aMonitor%_aView_#1
|
||||||
Log_dbg_bare(2, "View (" . v . ") wndIds: " . View_#%Manager_aMonitor%_#%v%_wndIds)
|
Debug_logMessage("DEBUG[2] View (" . v . ") wndIds: " . View_#%Manager_aMonitor%_#%v%_wndIds, 2, False)
|
||||||
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%v%_wndIds, 1
|
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%v%_wndIds, 1
|
||||||
StringSplit, wndId, wndIds, `;
|
StringSplit, wndId, wndIds, `;
|
||||||
Log_dbg_bare(2, "wndId count: " . wndId0)
|
Debug_logMessage("DEBUG[2] wndId count: " . wndId0, 2, False)
|
||||||
If (wndId0 > 1) {
|
If (wndId0 > 1) {
|
||||||
If Manager_#%aWndId%_isFloating
|
If Manager_#%aWndId%_isFloating
|
||||||
Manager_winSet("Bottom", "", aWndId)
|
Manager_winSet("Bottom", "", aWndId)
|
||||||
|
@ -62,10 +62,10 @@ View_activateWindow(d) {
|
||||||
direction = 1
|
direction = 1
|
||||||
Else
|
Else
|
||||||
direction = -1
|
direction = -1
|
||||||
Log_dbg_bare(2, "Current wndId index: " . i)
|
Debug_logMessage("DEBUG[2] Current wndId index: " . i, 2, False)
|
||||||
j := Manager_loop(i, d, 1, wndId0)
|
j := Manager_loop(i, d, 1, wndId0)
|
||||||
Loop, % wndId0 {
|
Loop, % wndId0 {
|
||||||
Log_dbg_bare(2, "Next wndId index: " . j)
|
Debug_logMessage("DEBUG[2] Next wndId index: " . j, 2, False)
|
||||||
wndId := wndId%j%
|
wndId := wndId%j%
|
||||||
Manager_winSet("AlwaysOnTop", "On", wndId)
|
Manager_winSet("AlwaysOnTop", "On", wndId)
|
||||||
Manager_winSet("AlwaysOnTop", "Off", wndId)
|
Manager_winSet("AlwaysOnTop", "Off", wndId)
|
||||||
|
@ -135,7 +135,7 @@ View_delWnd(m, v, wndId) {
|
||||||
|
|
||||||
View_arrange(m, v) {
|
View_arrange(m, v) {
|
||||||
Local fn, l, wndIds
|
Local fn, l, wndIds
|
||||||
Log_dbg_msg(1, "View_arrange(" . m . ", " . v . ")")
|
Debug_logMessage("DEBUG[1] View_arrange(" . m . ", " . v . ")", 1)
|
||||||
; All window actions are performed on independent windows. A delay won't help.
|
; All window actions are performed on independent windows. A delay won't help.
|
||||||
SetWinDelay, 0
|
SetWinDelay, 0
|
||||||
l := View_#%m%_#%v%_layout_#1
|
l := View_#%m%_#%v%_layout_#1
|
||||||
|
@ -441,7 +441,6 @@ View_draw_stack( arrName, off, len, dir, x, y, w, h, margin ) {
|
||||||
; margin - Number of pixels to put between the windows.
|
; margin - Number of pixels to put between the windows.
|
||||||
View_draw_row( arrName, off, len, dir, axis, x, y, w, h, margin ) {
|
View_draw_row( arrName, off, len, dir, axis, x, y, w, h, margin ) {
|
||||||
Local base, inc, x_inc, y_inc, wHeight, wWidth
|
Local base, inc, x_inc, y_inc, wHeight, wWidth
|
||||||
;Log_bare("View_draw_row(" . arrName . ", " . off . ", " . len . ", " . dir . ", " . axis . ", " . x . ", " . y . ", " . w . ", " . h . ", " . margin . ")")
|
|
||||||
If (dir = 0) {
|
If (dir = 0) {
|
||||||
; Left-to-right and top-to-bottom, depending on axis
|
; Left-to-right and top-to-bottom, depending on axis
|
||||||
base := off
|
base := off
|
||||||
|
@ -515,7 +514,7 @@ View_arrange_tile(m, v, wndIds) {
|
||||||
|
|
||||||
StringTrimRight, wndIds, wndIds, 1
|
StringTrimRight, wndIds, wndIds, 1
|
||||||
StringSplit, View_arrange_tile_wndId, wndIds, `;
|
StringSplit, View_arrange_tile_wndId, wndIds, `;
|
||||||
Log_dbg_msg(1, "View_arrange_tile: (" . View_arrange_tile_wndId0 . ") " . wndIds)
|
Debug_logMessage("DEBUG[1] View_arrange_tile: (" . View_arrange_tile_wndId0 . ") " . wndIds, 1)
|
||||||
If (View_arrange_tile_wndId0 = 0)
|
If (View_arrange_tile_wndId0 = 0)
|
||||||
Return
|
Return
|
||||||
|
|
||||||
|
@ -558,7 +557,6 @@ View_arrange_tile(m, v, wndIds) {
|
||||||
secondary_areas := Ceil(msplit / dimAligned)
|
secondary_areas := Ceil(msplit / dimAligned)
|
||||||
areas_remaining := secondary_areas
|
areas_remaining := secondary_areas
|
||||||
windows_remaining := msplit
|
windows_remaining := msplit
|
||||||
;Log_bare("msplit: " . msplit . "; layoutMX/Y: " . dimAligned . "; secondary_areas: " . secondary_areas . "; areas_remaining: " . areas_remaining . "; windows_remaining: " . windows_remaining)
|
|
||||||
Loop, % secondary_areas {
|
Loop, % secondary_areas {
|
||||||
View_split_region(Not (axis2 - 1), (1/areas_remaining), x1, y1, w1, h1, mx1, my1, mw1, mh1, x1, y1, w1, h1)
|
View_split_region(Not (axis2 - 1), (1/areas_remaining), x1, y1, w1, h1, mx1, my1, mw1, mh1, x1, y1, w1, h1)
|
||||||
draw_windows := dimAligned
|
draw_windows := dimAligned
|
||||||
|
|
Loading…
Reference in a new issue