AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bug.n - Tiling Window Manager
Goto page 1, 2, 3, 4, 5, 6, 7  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
joten'
Guest





PostPosted: Sat Jun 28, 2008 12:02 pm    Post subject: bug.n - Tiling Window Manager Reply with quote

Please see http://www.autohotkey.net./~joten/ for updated information and the latest version.

' wanted to share this one: dWm - dynamic window management

function
(1) "tiling window management" by positioning and sizing windows according to a specified layout selected by key stroke
(2) "virtual desktops" with the slightly different concept of tagging windows and restricting the view to windows with the same tag

download
dWm 0.3.5

known bug
If windows are resized and positioned automatically (autoResizeAndPositionWindowsFlag := true), this is triggered by shell messages (HSHELL_WINDOWCREATED and HSHELL_WINDOWDESTROYED). Sometimes this happens unexpectedly, if an application in systray pops up (in my case it seems to be the commodo firewall) or in firefox with popup blocker and an according website or with windows explorer and its child windows.

history
Most times I use linux for my "personal computer experience" and became addicted to tiling window management in form of dwm and wmii. So I wanted to have something similar when working with windows, but could not find anything usable - no shell replacement seems to do this and none of these seems to be up to date for windows vista, the only thing I found was "siaynoq" Shocked . Finally I found GridMove and with this in mind and a lot of forum search I assembled all to fit in dWm Smile . I hope it is usefull for someone else but me.

I have listed the whole code below for direct review and forum search.

dWm.ahk
Code:
/*
   title:       dWm (dynamic window managment for Windows)
   author:    joten
   version:    0.3.5
   date:    27.06.2008
   function:    "tiling window management" by positioning and sizing windows according to a specified layout selected by key stroke
         "virtual desktops" with the slightly different concept of tagging windows and restricting the view to windows with the same tag
   comment:    first impression of dynamic (tiling) window management: http://www.suckless.org/wiki/dwm
         hints at implementing window management with AutoHotkey: http://jgpaiva.donationcoders.com/gridmove.html (no code copied)
         source for virtual desktops (tagging): http://www.autohotkey.com/forum/topic6182.html (code copied, but mostly rewritten to support arrays storing the window ids)
         source for array handling (AHKArray): http://www.autohotkey.com/forum/topic14881.html (olegbl)
         If code was copied AutoHotkey from the forum, it has been commented at the end of the code snippet.
   license:    The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see license.txt).
*/

; <init (editable in parts)>
   OnExit, CleanUp    ; clean up (virtual desktops) in particular in case of an error (otherwise some windows might get lost) and show the window titlebars
   SetBatchLines, -1
   SetWinDelay, 0
   IfExist %A_ScriptDir%\images\dWm.ico
      Menu, Tray, Icon, %A_ScriptDir%\images\dWm.ico

   ; <options (editable)>
      maxViewNumber := 4
      autoDisplayViewNumberFlag := true
      OSDFontName    := "Tahoma"
      OSDFontColor    := "FF8000"
      OSDFontFormat   = 600
      OSDOpacity    := 70

      layoutMode    = s       ; m/b/s
      numberOfAreas   := 1       ; < 9
      splitLayout    = v       ; v/h
      splitRatio       := 0.5    ; <= 1
      hideTitlebarFlag   := true
      autoResizeAndPositionWindowsFlag := true
      autoDisplayLayoutGridFlag    := true
      exceptions          = Button,Shell_TrayWnd,WindowsForms10.Window.8.app.0.3d893c,#32770
   ; </options>

   activeView    := 1
   noViewAction    := true    ; "autoResizeAndPositionWindows" does not work together with the tagging/view functions, because after a reload of the script and switching the view or tagging a window, HSHELL_WINDOWDESTROYED or HSHELL_WINDOWCREATED are detected and the "windows" array is rewritten, while windows are hidden or shown.

   viewWindows    := AHKANewArray()
   windows       := AHKANewArray()
   Loop, %maxViewNumber%
      windows    := AHKAAdd(windows, viewWindows)

   If hideTitlebarFlag
      hideTitlebars(true)
   getWorkingAreaSizeAndPosition()
   resizeAndPositionWindows()
; </init>

; <main>
   Gui +LastFound
   hWnd := WinExist()

   DllCall("RegisterShellHookWindow", UInt, hWnd)
   MsgNum := DllCall("RegisterWindowMessage", Str, "SHELLHOOK")
   OnMessage(MsgNum, "ShellMessage")

   ; Return    ; End of Auto-Execute Section
   ; source: http://www.autohotkey.com/forum/viewtopic.php?p=123323#123323 (SKAN)
; </main>

; <hotkeys (editable in parts)>
   Loop, %maxViewNumber%
      Hotkey, !%A_Index%, switchToView
   Hotkey, !-, displayViewNumber             ; editable
   Hotkey, !0, displayOverView             ; editable

   Loop, 9
      Hotkey, #%A_Index%, setNumberOfAreas
   Hotkey, #0, setNumberOfAreas          ; editable
   Hotkey, #m, setLayoutMode
   Hotkey, #b, setLayoutMode
   Hotkey, #s, setLayoutMode
   Hotkey, #v, setSplitLayout
   Hotkey, #h, setSplitLayout

   Hotkey, IfWinActive
      Loop, %maxViewNumber%
      {
         Hotkey, ^!%A_Index%, setTagOfActiveWindow
         Hotkey, ^+!%A_Index%, addTagToActiveWindow
      }

   #BS::Reload                      ; editable
   #Esc::ExitApp                      ; editable

   LWin & Right::AltTab                   ; editable
   LWin & Left::ShiftAltTab                ; editable
   #g::displayLayoutGrid()

   ;<shortcuts (editable)>
      #F1::Run, Firefox
   ;</shortcuts>

   #IfWinActive
      #c::closeWindow()                ; editable
; </hotkeys>

; <functions>
   getWindows(view) {
      Global

      WinGet, windowList, List,,, Program Manager
      viewWindows := AHKANewArray()
      Loop, %windowList% {    ; write the list to an array and remove the task bar window id
         id := windowList%A_Index%
         WinGetClass, windowClass, ahk_id %id%
         If windowClass in %exceptions%
            Continue
         Else
            viewWindows    := AHKAAdd(viewWindows, id)
      }
      windows := AHKASet(windows, viewWindows, view)
   }

   ShellMessage(wParam, lParam) {
      Global

      If ( hideTitlebarFlag and (wParam = 1) ) {   ; HSHELL_WINDOWCREATED = 1
         WinSet, Style, -0xC00000, ahk_id %lParam%,
      }
      If ( autoResizeAndPositionWindowsFlag and noViewAction and ( (wParam = 1) or (wParam = 2) ) ) {   ; HSHELL_WINDOWCREATED = 1, HSHELL_WINDOWDESTROYED = 2
         autoResizeAndPositionWindows()
      }
   }

   autoResizeAndPositionWindows() {
      Global

      getWindows(activeView)
      viewWindows := AHKAGet(windows, activeView)
      numberOfAreas := AHKASize(viewWindows)
      resizeAndPositionWindows()
   }

   #include functions\AHKArray.ahk
   #include functions\tagging.ahk
   #include functions\window_management.ahk
   #include functions\OSD.ahk
; </functions>

CleanUp:    ; show all windows from all desktops and the according titlebars on exit
Loop, %maxViewNumber%
   showWindows(A_Index, true)
hideTitlebars(false)
ExitApp

window_management.ahk
Code:
/*
   title:       dWm (dynamic window managment for Windows)
   author:    joten
   version:    0.3.5
   date:    27.06.2008
   comment:    If code was copied from the AutoHotkey forum, it has been commented at the end of the code snippet.
   license:    The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see license.txt).
*/

getWorkingAreaSizeAndPosition() {
   Global
   
   getTaskbarSizeAndPosition()
   SysGet, monitor, Monitor
   If ( (taskbarPosition = "top") or (taskbarPosition = "bottom") ) {
      workingAreaWidth    := monitorRight - monitorLeft
      workingAreaHeight    := monitorBottom - monitorTop - taskbarHeight
      workingAreaX       := monitorLeft
      If (taskbarPosition = "top") {
         workingAreaY    := monitorTop + taskbarHeight
      } Else {
         workingAreaY    := monitorTop
      }
   } Else {
      workingAreaWidth    := monitorRight - monitorLeft - taskbarWidth
      workingAreaHeight    := monitorBottom - monitorTop
      workingAreaY       := monitorTop
      If (taskbarPosition = "left") {
         workingAreaX    := monitorLeft + taskbarWidth
      } Else {
         workingAreaX    := monitorLeft
      }
   }
}

getTaskbarSizeAndPosition() {
   Global

   ; get dimensions and position of taskbar (specialcase autohide ?)
   WinGetPos, taskbarX, taskbarY, taskbarWidth, taskbarHeight, ahk_class Shell_TrayWnd
   taskbarWidth += taskbarX
   taskbarHeight += taskbarY

   ; find out if its on top/left/bottom/right with its x,y
   ; x0,y0 ( width < height )  means its on top
   if ( taskbarX < 10 and taskbarWidth < taskbarHeight )
      taskbarPosition = left

   ; x0,y0 ( width >=  height )  means its on left
   if ( taskbarX < 10 and taskbarWidth >= taskbarHeight )     
      taskbarPosition = top

   ; x+,y0 means its on right
   if ( taskbarX > 10 )
      taskbarPosition = right

   ; x0,y+ means its on bottom
   if ( taskbarY > 10 )
      taskbarPosition = bottom

   Return
}
; source: http://www.autohotkey.com/forum/topic8597.html (holomind)

resizeAndPositionWindows() {
   Global

   getSizesAndPositions()
   viewWindows := AHKAGet(windows, activeView)
   viewWindowsTotal := AHKASize(viewWindows)
   Loop, %viewWindowsTotal%
   {
      id    := AHKAGet(viewWindows, A_Index)
      If (layoutMode = "m") {
         If ( (numberOfAreas = 1) or (A_Index = 1) ) {
            index := 1
         } Else {
            index := Mod(A_Index - 1, numberOfAreas - 1) + 1
            If index = 1
               index := numberOfAreas
         }
      } Else If (layoutMode = "b") {
         If ( (numberOfAreas = 1) or (A_Index = 1) ) {
            index := 1
         } Else If ( (numberOfAreas = 2) or (A_index = 2) ) {
            index := 2
         } Else {
            index := Mod(A_Index - 2, numberOfAreas - 2) + 2
            If index = 2
               index := numberOfAreas
         }
      } Else If (layoutMode = "s") {
         index := Mod(A_Index, numberOfAreas)
         If index = 0
            index := numberOfAreas
      }
      x       := AHKAGet(positionsX, index)
      y       := AHKAGet(positionsY, index)
      width    := AHKAGet(sizesWidth, index)
      height    := AHKAGet(sizesHeight, index)
      WinMove, ahk_id %id%, , %x%, %y%, %width%, %height%
   }
}

getSizesAndPositions() {
   Global

   positionsX    := AHKANewArray()
   positionsY       := AHKANewArray()
   sizesWidth    := AHKANewArray()
   sizesHeight    := AHKANewArray()
   If (layoutMode = "m") {
      positionsX   := AHKAAdd(positionsX, workingAreaX)
      positionsY    := AHKAAdd(positionsY, workingAreaY)
      If (splitLayout = "v") {
         sizeWidth       := workingAreaWidth/(1+splitRatio)
         sizesWidth    :=AHKAAdd(sizesWidth, sizeWidth)
         sizesHeight   :=AHKAAdd(sizesHeight, workingAreaHeight)
         positionX       := workingAreaX+workingAreaWidth/(1+splitRatio)
         positionY       := workingAreaY
         sizeWidth       := splitRatio/(1+splitRatio)*workingAreaWidth
         sizeHeight      := Round(workingAreaHeight/(numberOfAreas-1))
         Loop, % numberOfAreas-1
         {
            positionsX    := AHKAAdd(positionsX, positionX)
            positionsY       := AHKAAdd(positionsY, positionY)
            sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
            sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
            positionY += sizeHeight
         }
      } Else If (splitLayout = "h") {
         sizesWidth    :=AHKAAdd(sizesWidth, workingAreaWidth)
         sizeHeight    := workingAreaHeight/(1+splitRatio)
         sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
         positionX       := workingAreaX
         positionY       := workingAreaY+workingAreaHeight/(1+splitRatio)
         sizeWidth       := Round(workingAreaWidth/(numberOfAreas-1))
         sizeHeight      := splitRatio/(1+splitRatio)*workingAreaHeight
         Loop, % numberOfAreas-1
         {
            positionsX    := AHKAAdd(positionsX, positionX)
            positionsY       := AHKAAdd(positionsY, positionY)
            sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
            sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
            positionX += sizeWidth
         }
      }
   } Else If (layoutMode = "b") {
      positionsX    := AHKAAdd(positionsX, workingAreaX)
      positionsY       := AHKAAdd(positionsY, workingAreaY)
      If (splitLayout = "v") {
         sizeWidth       := workingAreaWidth/(1+splitRatio)
         sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
         sizeHeight    := workingAreaHeight/2
         sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
         positionsX    := AHKAAdd(positionsX, workingAreaX)
         positionY       := workingAreaY+sizeHeight
         positionsY       := AHKAAdd(positionsY, positionY)
         sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
         sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
         positionX       := workingAreaX+workingAreaWidth/(1+splitRatio)
         positionY       := workingAreaY
         sizeWidth       := splitRatio/(1+splitRatio)*workingAreaWidth
         sizeHeight      := Round(workingAreaHeight/(numberOfAreas-2))
         Loop, % numberOfAreas-2
         {
            positionsX    := AHKAAdd(positionsX, positionX)
            positionsY       := AHKAAdd(positionsY, positionY)
            sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
            sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
            positionY += sizeHeight
         }
      } Else If (splitLayout = "h") {
         sizeWidth       := workingAreaWidth/2
         sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
         sizeHeight    := workingAreaHeight/(1+splitRatio)
         sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
         positionX       := workingAreaX+sizeWidth
         positionsX    := AHKAAdd(positionsX, positionX)
         positionsY       := AHKAAdd(positionsY, workingAreaY)
         sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
         sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
         positionX       := workingAreaX
         positionY       := workingAreaY+workingAreaHeight/(1+splitRatio)
         sizeWidth       := Round(workingAreaWidth/(numberOfAreas-2))
         sizeHeight      := splitRatio/(1+splitRatio)*workingAreaHeight
         Loop, % numberOfAreas-2
         {
            positionsX    := AHKAAdd(positionsX, positionX)
            positionsY       := AHKAAdd(positionsY, positionY)
            sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
            sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
            positionX += sizeWidth
         }
      }
   } Else If (layoutMode = "s") {
      If (splitLayout = "v") {
         positionX    := workingAreaX
         sizeWidth    := Round(workingAreaWidth/numberOfAreas)
         Loop, %numberOfAreas%
         {
            positionsX    := AHKAAdd(positionsX, positionX)
            positionsY       := AHKAAdd(positionsY, workingAreaY)
            sizesWidth    := AHKAAdd(sizesWidth, sizeWidth)
            sizesHeight    := AHKAAdd(sizesHeight, workingAreaHeight)
            positionX += sizeWidth
         }
      } Else If (splitLayout = "h") {
         positionY    := workingAreaY
         sizeHeight   := Round(workingAreaHeight/numberOfAreas)
         Loop, %numberOfAreas%
         {
            positionsX    := AHKAAdd(positionsX, workingAreaX)
            positionsY       := AHKAAdd(positionsY, positionY)
            sizesWidth    := AHKAAdd(sizesWidth, workingAreaWidth)
            sizesHeight    := AHKAAdd(sizesHeight, sizeHeight)
            positionY += sizeHeight
         }
      }
   }
}

setNumberOfAreas:
   StringReplace, numberOfAreas, A_ThisHotkey, #,
   getWindows(activeView)
   If (numberOfAreas+0 = 0) {
      viewWindows := AHKAGet(windows, activeView)
      numberOfAreas := AHKASize(viewWindows)
   }
   resizeAndPositionWindows()
   If autoDisplayLayoutGridFlag
      displayLayoutGrid()
Return

setLayoutMode:
   StringReplace, layoutMode, A_ThisHotkey, #,
   getWindows(activeView)
   resizeAndPositionWindows()
   If autoDisplayLayoutGridFlag
      displayLayoutGrid()
Return

setSplitLayout:
   StringReplace, splitLayout, A_ThisHotkey, #,
   getWindows(activeView)
   resizeAndPositionWindows()
   If autoDisplayLayoutGridFlag
      displayLayoutGrid()
Return

activateWindow(index) {
   Global

   getWindows(activeView)
   viewWindows := AHKAGet(windows, activeView)
   id := AHKAGet(viewWindows, index)
   WinActivate, ahk_id %id%
}

closeWindow() {
   WinGet, id, ID, A
   WinClose, ahk_id %id%
}

hideTitlebars(hide) {
   Global

   getWindows(activeView)
   viewWindows := AHKAGet(windows, activeView)
   viewWindowsTotal := AHKASize(viewWindows)
   If (hide) {
      Loop, %viewWindowsTotal%
      {
         id := AHKAGet(viewWindows, A_Index)
         WinSet, Style, -0xC00000, ahk_id %id%,
      }
   } Else {
      Loop, %viewWindowsTotal%
      {
         id := AHKAGet(viewWindows, A_Index)
         WinSet, Style, +0xC00000, ahk_id %id%,
      }
   }
}

tagging.ahk
Code:
/*
   title:       dWm (dynamic window managment for Windows)
   author:    joten
   version:    0.3.5
   date:    27.06.2008
   comment:    If code was copied from the AutoHotkey forum, it has been commented at the end of the code snippet.
   license:    The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see license.txt).
*/

switchToView:
   StringReplace, newView, A_ThisHotkey, !,
   If (activeView <> newView+0) {
      getWindows(activeView)
      showWindows(activeView, false)

      showWindows(newView, true)
      activeView := newView
      activateLastActiveWindow(activeView)
      If autoResizeAndPositionWindowsFlag
         autoResizeAndPositionWindows()
      If autoDisplayViewNumberFlag
         OSD(activeView)
   }
Return

showWindows(view, show) {    ; if show is true then the windows with the tag %view% are shown, else hidden
   Global

   noViewAction := false
   viewWindows := AHKAGet(windows, view)
   viewWindowsTotal := AHKASize(viewWindows)
   Loop, %viewWindowsTotal% {
      id := AHKAGet(viewWindows, A_Index)
      If (show) {
         WinShow, ahk_id %id%
      } Else {
         WinHide, ahk_id %id%
      }
   }
   noViewAction := true
}

activateLastActiveWindow(view) {
   Global

   viewWindows := AHKAGet(windows, view)
   id := AHKAGet(viewWindows, 1)
   WinActivate, ahk_id %id%
}

setTagOfActiveWindow:
   StringReplace, newTag, A_ThisHotkey, ^!,
   WinGet, id, ID, A
   removeWindowTags(id)
   addWindowTag(id, newTag)

   noViewAction := false
   If newTag+0 <> activeView
      WinHide, ahk_id %id%
   noViewAction := true
   activateLastActiveWindow(activeView)
   If autoResizeAndPositionWindowsFlag
      autoResizeAndPositionWindows()
Return

removeWindowTags(id) {
   Global

   Loop, %maxViewNumber% {
      viewWindows := AHKAGet(windows, A_Index)
      index := AHKAFind(viewWindows, id, 1)
      If index > 0
         viewWindows := AHKARemove(viewWindows, index)
      windows := AHKASet(windows, viewWindows, A_Index)
   }
}

addWindowTag(id, newTag) {
   Global
   
   viewWindows := AHKAGet(windows, newTag)
   viewWindows := AHKAAdd(viewWindows, id)
   windows := AHKASet(windows, viewWindows, newTag)
}
   
addTagToActiveWindow:
   StringReplace, newTag, A_ThisHotkey, ^+!,
   WinGet, id, ID, A
   addWindowTag(id, newTag+0)
Return

OSD.ahk
Code:
/*
   title:       dWm (dynamic window managment for Windows)
   author:    joten
   version:    0.3.5
   date:    27.06.2008
   comment:    If code was copied from the AutoHotkey forum, it has been commented at the end of the code snippet.
   license:    The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see license.txt).
*/

displayViewNumber:
   OSD(activeView)
Return

OSD(text, OSDFontSize=80, time=500) {
   Global OSDFontName, OSDFontColor, OSDOpacity, OSDFontFormat

   Gui, 2: Default
   wndTitle = "blkOsdWnd2"
   If (wndTitle) {
      IfWinExist, %wndTitle%
         WinClose
         Gui, Destroy
   }
   Gui, +LastFound +AlwaysOnTop +ToolWindow -Caption
   Gui, Margin, 0, 0    ; pixels of space to leave at the left/right and top/bottom sides of the window when auto-positioning.
   Gui, Color, ffffff    ; background color
   Gui, Font, c%OSDFontColor% s%OSDFontSize% w%OSDFontFormat%, %OSDFontName%
   Gui, Add, Text, +0x80 v & "blkOsdCtrlName2", %text%    ; 0x80 = SS_NOPREFIX -> Ampersand (&) is shown instead of underline one letter for Alt+letter navigation
   WinSet, ExStyle, +0x20    ; WS_EX_TRANSPARENT -> mouse klickthrough
   opacity := OSDOpacity * 255 / 100
   WinSet, TransColor, ffffff %opacity%
   Gui, Show, xCenter yCenter +NoActivate, %wndTitle%
   Sleep, %time%
   Gui, Destroy
}
; source: http://www.autohotkey.com/forum/topic8959.html

displayOverView:
   wndTitle = "blkOsdWnd3"
   If (wndTitle) {
      Gui, 3: Default
      IfWinExist, %wndTitle%
      {
         WinClose
         Gui, Destroy
      } Else {
         OSDFontSize := 16
         rows := Round(workingAreaHeight/OSDFontSize*0.4)
         width := Round(workingAreaWidth*0.7)
         Gui, +LastFound +AlwaysOnTop +ToolWindow -Caption
         Gui, Margin, 0, 0
         Gui, Color, ffffff
         Gui, Font, c%OSDFontColor% s%OSDFontSize% w%OSDFontFormat%, %OSDFontName%
         Gui, Add, ListView, r%rows% w%width%, View|Window Title

         DetectHiddenWindows, on
         Loop, %maxViewNumber%
         {
            viewNumber    := A_Index
            viewWindows    := AHKAGet(windows, viewNumber)
            viewWindowsTotal := AHKASize(viewWindows)
            Loop, %viewWindowsTotal%
            {
               id := AHKAGet(viewWindows, A_Index)
               WinGetTitle, windowTitle, ahk_id %id%
               If (A_Index = 1) {
                   LV_Add("", viewNumber, windowTitle)
               } Else {
                  LV_Add("", "", windowTitle)
               }
            }
         }
         DetectHiddenWindows, off

         LV_ModifyCol(2)  ; Auto-size each column to fit its contents.
         ; WinSet, ExStyle, +0x20    ; WS_EX_TRANSPARENT -> mouse klickthrough
         opacity := OSDOpacity * 255 / 100
         WinSet, TransColor, ffffff %opacity%
         Gui, Show, xCenter yCenter +NoActivate, %wndTitle%
      }
   }
Return

displayLayoutGrid() {
   Global

   wndTitle = "blkOsdWnd4"
   If (wndTitle) {
      Gui, 4: Default
      IfWinExist, %wndTitle%
      {
         WinClose
         Gui, Destroy
      } Else {
         OSDFontSize := 24
         thickness := 2
         Gui, +LastFound +AlwaysOnTop +ToolWindow -Caption
         Gui, Margin, 0, 0
         Gui, Color, ffffff
         Gui, Font, c%OSDFontColor% s%OSDFontSize% w%OSDFontFormat%, %OSDFontName%

         getSizesAndPositions()
         Loop, %numberOfAreas%
         {
            x       := AHKAGet(positionsX, A_Index)
            y       := AHKAGet(positionsY, A_Index)
            width    := AHKAGet(sizesWidth, A_Index)
            height    := AHKAGet(sizesHeight, A_Index)
            x1 := x,             y1 := y,             w1 := width,       h1 := thickness
            x2 := x,             y2 := y,             w2 := thickness,    h2 := height
            x3 := x+width-thickness,    y3 := y,             w3 := thickness,    h3 := height
            x4 := x,             y4 := y+height-thickness,    w4 := width,       h4 := thickness
            cx := x+(width-OSDFontSize)/2, cy := y+(height-OSDFontSize)/2
            Gui, Add, Picture, w%w1% h%h1% x%x1% y%y1%, images\grid.bmp
            Gui, Add, Picture, w%w2% h%h2% x%x2% y%y2%, images\grid.bmp
            Gui, Add, Picture, w%w3% h%h3% x%x3% y%y3%, images\grid.bmp
            Gui, Add, Picture, w%w4% h%h4% x%x4% y%y4%, images\grid.bmp
            Gui, Add, Text, x%cx% y%cy% +0x80 v & "blkOsdCtrlName2", %A_Index%
         }

         WinSet, ExStyle, +0x20    ; WS_EX_TRANSPARENT -> mouse klickthrough
         opacity := OSDOpacity * 255 / 100
         WinSet, TransColor, ffffff %opacity%
         GUIWidth = %A_ScreenWidth%
         GUIHeight = %A_ScreenHeight%
         Gui, Show, x0 y0 w%GUIWidth% h%GUIHeight% +NoActivate, %wndTitle%
         Sleep, 1000
         Gui, Destroy
      }
   }
}

help.txt
Code:
=====================
=       About       =
=====================
title:    dWm (dynamic window managment for Windows)
author:   joten
version:  0.3.5
date:     27.06.2008
function: "tiling window management" by positioning and sizing windows according to a specified layout selected by key stroke
          "virtual desktops" with the slightly different concept of tagging windows and restricting the view to windows with the same tag
comment:  first impression of dynamic (tiling) window management: http://www.suckless.org/wiki/dwm
          hints at implementing window management with AutoHotkey: http://jgpaiva.donationcoders.com/gridmove.html (no code copied)
          source for virtual desktops (tagging): http://www.autohotkey.com/forum/topic6182.html (code copied, but mostly rewritten to support arrays storing the window ids)
          source for array handling (AHKArray): http://www.autohotkey.com/forum/topic14881.html (olegbl)
          If code was copied AutoHotkey from the forum, it has been commented at the end of the code snippet.
license:  The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see license.txt).

=====================
=      Options      =
=====================
maxViewNumber             : Maximum number of views/tags; the absolute maximum is 9
autoDisplayViewNumberFlag : If set to true, the view number is displayed when switching the view.
OSDFontName               : The font name for the OSD (on screen display)
OSDFontColor              : The font color for the OSD (on screen display)
OSDFontFormat             : The font format (boldness) for the OSD (on screen display)
OSDOpacity                : The opacity of the OSD (on screen display)
layoutMode                : Default value for the layout mode
                               m = mono or master (one window in a master area, the other in a stacking area)
                               b = bi (two windows in a splitted master area, the other in a stacking area)
                               s = stack (no master, all windows are in teh stacking area)
numberOfAreas             : The number of areas, in which the windows can be positioned; e. g.
                               1 with mode s:       all windows are maximized
                               2 with mode m or s:    split screen
                               5 with mode m:       one window in the master area, 4 in the stacking area
splitLayout               : the direction of the stacking area
                               v = vertical
                               h = horizontal
splitRatio                : The ratio in which the current column or row will be split (right to left column or upper to
                            lower row) when the window is moved.      
hideTitlebarFlag          : If set to true, the titlebar of all windows is hidden leaving more space to the content.
autoResizeAndPositionWindowsFlag: If set to true, the number of areas is automatically set to the number of windows and all
            windows are resized and positioned accordingly; this action is triggered by opening or closing a window.
autoDisplayLayoutGridFlag : If set to true, the layout grid is displayed, when the layout is changed (by pressing Win+<m/b/s/v/h/<number>>
exceptions                : Classes of windows, which are excluded from the list of windows and therefor are not resized
                            and positioned; there seem to be windows, which are not shown in the taskbar (Shell_TrayWnd is
                            obvious) and therefor have to be excluded from the list of managed windows.

=====================
=      Hotkeys      =
=====================
Alt+<number>            : Switch to the <number>th view; number < maxViewNumber (see options)
Alt+-                   : Display the view number; ß is the key next to 0 on a german keyboard
Alt+0                   : Display a list of windows according to their tag (number)
Ctrl+Alt+<number>       : Set <number> as the only tag of the active window; number < maxViewNumber (see options)
Ctrl+Shift+Alt+<number> : Add <number> to the tags of the active windsow; number < maxViewNumber (see options)

Win+<number>            : Set the number of areas used to position the windows
Win+0                   : Set the number of areas to the number of windows on the active view
Win+<m/b/s>             : Set the layout mode
                               m = mono or master (one window in a master area, the other in a stacking area)
                               b = bi (two windows in a splitted master area, the other in a stacking area)
                               s = stack (no master, all windows are in teh stacking area)
Win+<v/h>               : Set the direction of the stacking area
                               v = vertical
                               h = horizontal
Win+g                   : Display the grid of the layout
Win+<Left Arrow>        : Open the "Alt+Tab" menu, switching to the next window; like Alt+Tab
Win+<Right Arrow>       : Open the "Alt+Tab" menu, switching to the previous window; like Alt+Shift+Tab
Win+c                   : Closing the active window

Win+Backspace           : Reload the script
Win+Escape              : Exit the script

=     Shortcuts     =
Shortcuts can be added as needed, if they are not conflicting with the existing ones.
Back to top
joten
Guest





PostPosted: Mon Jul 07, 2008 6:05 pm    Post subject: dWm - new version Reply with quote

I have added some features and therfor post a new version.

download
dWm 0.4.1



new features
(1) A new layout mode: f = fullscreen (no splitting, all windows are in fullscreen size; in effect this mode is like s1, but if the automatically resizing and positioning of windows is activated, the mode will not be changed, when a new window is opened.)
(2) Set the active window as the primary master by pressing Win+Enter
(3) Toggling the state (hidden or shown) of the taskbar by pressing Win+t
(4) Moving the deviding line in a master mode (b/m) to the right/left or down/up by de-/increasing "splitRatio" by "splitRatioIncrement"

known bug
The same as above; I could not imagine a solution for this yet. But also no bug reports Rolling Eyes.

comments
For further explanation: dWm is unexceptional keyboard driven; therefor all functionality can be read from the "hotkeys" and "options" section. According to that these sections are explained in the help file.

help.txt
Code:
=====================
=       About       =
=====================
title:    dWm (dynamic window managment for Windows)
author:   joten
version:  0.4.1
date:     07.07.2008 (last change: 07.07.2008)
function: "tiling window management" by positioning and sizing windows according to a specified layout selected by key stroke
          "virtual desktops" with the slightly different concept of tagging windows and restricting the view to windows with the same tag
comment:  first impression of dynamic (tiling) window management: http://www.suckless.org/wiki/dwm
          hints at implementing window management with AutoHotkey: http://jgpaiva.donationcoders.com/gridmove.html (no code copied)
          source for virtual desktops (tagging): http://www.autohotkey.com/forum/topic6182.html (code copied, but mostly rewritten to support
          arrays storing the window ids)
          source for array handling (AHKArray): http://www.autohotkey.com/forum/topic14881.html (olegbl)
          If code was copied AutoHotkey from the forum, it has been commented at the end of the code snippet.
license:  The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see license.txt).

=====================
=      Options      =
=====================
maxViewNumber             : Maximum number of views/tags; the absolute maximum is 9
autoDisplayViewNumberFlag : If set to true, the view number is displayed when switching the view.
OSDFontName               : The font name for the OSD (on screen display)
OSDFontColor              : The font color for the OSD (on screen display)
OSDFontFormat             : The font format (boldness) for the OSD (on screen display)
OSDOpacity                : The opacity of the OSD (on screen display)
layoutMode                : Default value for the layout mode
                               m = mono or master (one window in a master area, the other in a stacking area)
                               b = bi (two windows in a splitted master area, the other in a stacking area)
                               s = stack (no master, all windows are in the stacking area)
                               f = fullscreen (no splitting, all windows are in fullscreen size; in effect this mode is like s1, but if the
                                   automatically resizing and positioning of windows is activated, the mode will not be changed, when a new
                                   window is opened.)
numberOfAreas             : The number of areas, in which the windows can be positioned; e. g.
                               1 with mode s:       all windows are maximized
                               2 with mode m or s:    split screen
                               5 with mode m:       one window in the master area, 4 in the stacking area
splitLayout               : the direction of the stacking area
                               v = vertical
                               h = horizontal
splitRatio                : The ratio in which the current column or row will be split (right to left column or upper to
                            lower row) when the window is moved.
splitRatioIncrement       : Increment by wich "splitRatio" is decreased or increased when the master area is resized
hideTitlebarFlag          : If set to true, the titlebar of all windows is hidden leaving more space to the content.
hideTaskbarFlag           : If set to true, the taskbar is hidden at start time (see hotkey "Win+t" for toggling this option at run time).
autoResizeAndPositionWindowsFlag: If set to true, the number of areas is automatically set to the number of windows and all
                                  windows are resized and positioned accordingly; this action is triggered by opening or closing a window.
autoDisplayLayoutGridFlag : If set to true, the layout grid is displayed, when the layout is changed (by pressing Win+<m/b/s/v/h/<number>>
exceptions                : Classes of windows, which are excluded from the list of windows and therefor are not resized
                            and positioned; there seem to be windows, which are not shown in the taskbar (Shell_TrayWnd is
                            obvious) and therefor have to be excluded from the list of managed windows.

=====================
=      Hotkeys      =
=====================
Alt+<number>            : Switch to the <number>th view; number < maxViewNumber (see options)
Alt+ß                   : Display the view number; "ß" is the key next to "0" on a german keyboard, on an US-keyboard the key is "-".
                          This hotkey has to be changed, if not using a german (latin1-de) keyboard.
Alt+0                   : Display a list of windows according to their tag (number)
Ctrl+Alt+<number>       : Set <number> as the only tag of the active window; number < maxViewNumber (see options)
Ctrl+Shift+Alt+<number> : Add <number> to the tags of the active windsow; number < maxViewNumber (see options)

Win+<number>            : Set the number of areas used to position the windows
Win+0                   : Set the number of areas to the number of windows on the active view
Win+<m/b/s/f>           : Set the layout mode
                               m = mono or master (one window in a master area, the other in a stacking area)
                               b = bi (two windows in a splitted master area, the other in a stacking area)
                               s = stack (no master, all windows are in the stacking area)
                               f = fullscreen (no splitting, all windows are in fullscreen size; in effect this mode is like s1, but if the
                                   automatically resizing and positioning of windows is activated, the mode will not be changed, when a new
                                   window is opened.)
Win+<v/h>               : Set the direction of the stacking area
                               v = vertical
                               h = horizontal
Win+<Down Arrow>        : Decrease "splitRatio" by "splitRatioIncrement" and resize and position all windows, if in master (b/m) mode; moves
                          the deviding line to the right or down
Win+<Up Arrow>          : Increase "splitRatio" by "splitRatioIncrement" and resize and position all windows, if in master (b/m) mode; moves
                          the deviding line to the left or up
Win+Enter               : Set the active window as the primary master
Win+g                   : Display the grid of the layout
Win+<Left Arrow>        : Open the "Alt+Tab" menu, switching to the next window; like Alt+Tab
Win+<Right Arrow>       : Open the "Alt+Tab" menu, switching to the previous window; like Alt+Shift+Tab
Win+c                   : Closing the active window
Win+t                   : Toggling the state of the taskbar (see option hideTaskbarFlag)

Win+Backspace           : Reload the script
Win+Escape              : Exit the script

=     Shortcuts     =
Shortcuts can be added as needed, if they are not conflicting with the existing ones.
Back to top
pomj



Joined: 22 Feb 2007
Posts: 7

PostPosted: Thu Jul 10, 2008 8:32 am    Post subject: Reply with quote

Aaah GREAT !!

I will test this when i come home from work. I myself is addicted to larsWm when I'm on a linux machine. I've been searching for something similar in windows. NICE
Back to top
View user's profile Send private message
joten
Guest





PostPosted: Sat Jul 12, 2008 12:29 pm    Post subject: dWm - new tested version Reply with quote

I have to admit, that until now dWm was a one PC, one OS, one user software - on my PC with Windows Vista and the taskbar on top it worked. Wink

But I have done some improvements, added features for usability and tested the result more seriously.

download
dWm 0.5.4 (exe)
dWm 0.5.4 (zip)

new features
(1) The options are moved to an INI file
(2) A tray menu, with which the options can be set
(3) A more elaborated help (also accessible through the tray menu)
(4) An option for starting dWm with Windows (link in autostart)
(5) A shortcut editor for the hotkeys Win+Fx
(6) The executable version

dWm was tested with the following system configurations:
Operating system: Windows Vista Home Premium (SP 1)
AutoHotkey version: 1.0.47.06
Screen resolution: 1280x800 (Notebook)

Operating system: Windows XP Home
AutoHotkey version: 1.0.47.06
Screen resolution: 1024x768 (Notebook)

known bugs
- There is no support for multiple monitors. (no feature)
- At least on one PC with Windows XP the Win+<left / right arrow> hotkey with the Alt+Tab replacement is just going forward, if the<right arrow> has been pressed once. (minor bug)
- At least on one PC with Windows Vista the "Start" button sometimes stays, when the taskbar is hidden. (bug, not reproducable)

* I have implemented a ShellhookDelay, added two more exception lists and extended these, so that the old bug should no longer appear.
* There also was a bug in the window management functions, which caused all windows to disappear, when starting dWm with the taskbar at the bottom or right of the screen.

help.txt (help.html)
Code:


  About

   

title    dWm (dynamic window managment for Windows)
author   joten
version  0.5.4
date     12.07.2008

function
"tiling window management" by positioning and sizing windows according to a specified layout selected by key stroke
"virtual desktops" with the slightly different concept of tagging windows and restricting the view to windows with the same tag

comment
first impression of dynamic (tiling) window management: about - dwm - suckless.org <http://www.suckless.org/wiki/dwm>
hints at implementing window management with AutoHotkey: GridMove - DonationCode.com <http://jgpaiva.donationcoders.com/gridmove.html>
source for virtual desktops (tagging): Multiple virtual desktops <http://www.autohotkey.com/forum/topic6182.html> (code copied, but mostly rewritten to support arrays storing the window ids)
source for array handling: AHKArray (olegbl) <http://www.autohotkey.com/forum/topic14881.html>
source for embedding the internt explorer (IEControl/CoHelper): Internet Explorer Control - AutoHotkey <http://www.autohotkey.com/wiki/index.php?title=Internet_Explorer_Control>
If code was copied AutoHotkey from the forum, it has been commented at the end of the code snippet.

license
The code written by joten is licensed under the GPL (version 2) like AutoHotkey itself (see docs/license.html <license.html>).


  Help

   


    Description

*dWm* does, like its acronym says, *dynamic window management*. This
means, it arranges the windows either automatically when a window is
opened or closed, or on pressing a key combination according to a
specific layout. These layouts imply showing up to nine windows (or just
one) or all, arranging all side by side or up on each other, all in
fullscreen or in a mode called "master and stacking". All layouts have
in common, that they use the whole screen leaving no empty space. If
setting the option for automatically sizing and positioning windows (all
windows are shown), this will result in the concept of *tiling window
management*.
The "master and stacking" mode means, that one window or two (equally
sized side by side) is/are shown in a master area (most part of the
screen) and all others are shown equally sized in a stacking area.


Example showing a vertical master and stacking area with four windows

Additionally windows can be managed by *tagging* them with a number
between one and nine. By selecting the according *view*, just the
windows with the given tag are shown, the others are hidden. This is
quite like virtual desktops, but with tagging you can also give one
window two or more tags and therefor show this window on different views.


Example showing a horizontal master and stacking area with two windows
in the master area; also showing an OSD with an overview of all windows
with their given tags (stating on which views they reside)

All actions a user can do, beside setting the options, which is done
over the tray menu of dWm, are keyboard driven. All hotkeys are listed
below and briefly explained. Additionally the hotkeys Win+<function key
(Fx)> can be mapped to user defined files or folders, which then can be
executed or opened by pressing the according hotkey. These hotkeys
(shortcuts) are edited with the shortcut editor, which is accessible
over the tray menu. The files or folders can either be written in the
edit fields directly with the full path or selected by means of the
appropriate dialog, which is accessible by pressing the icons right to
the edit fields.


Example showing three windows in vertical stacking mode, titlebars
hidden and the shortcut editor on top.


    Installation

You can either use the script version or the executable.
The script version contains all files including images, documentation
and the AHK files in a folder or ZIP file (which has to be unpacked);
you will need AutoHotkey installed or associated to the AK exctension in
order to run the script. At start the folder containing the dWm.ahk file
must also contain the folders docs, images and functions including the
according files, thus the main script needs the AHK files in the
functions folder and copies the images and documentation into the user
profile (subfolder %A_AppData%\dWm)
%A_AppData% is a variable, whose value depends on the operating system,
in case of Windows Vista it is "AppData\Roaming", in case of Windows XP
it is "Application Data". dWm creates a subfolder "dWm" before copying
the files and also saves the options in an INI file, which is stored in
the same folder.
When using the executable version of dWm, the AHK scripts are compiled
in to this one executable and the images and documentation are packaged
into it as well. When executed dWm will copy the images and
documentation into the user profile and creates the INI file in there.


    Known issues

dWm was tested with the following system configurations:

Operating system   Windows Vista Home Premium (SP 1)
AutoHotkey version   1.0.47.06
Screen resolution   1280x800 (Notebook)


Operating system   Windows XP Home
AutoHotkey version   1.0.47.06
Screen resolution   1024x768 (Notebook)


    * There is no support for multiple monitors. (no feature)
    * At least on one PC with Windows XP the Win+<left / right arrow>
      hotkey with the Alt+Tab replacement is just going forward, if the
      <right arrow> has been pressed once. (minor bug)
    * At least on one PC with Windows Vista the "Start" button sometimes
      stays, when the taskbar is hidden. (bug, not reproducable)


Hotkeys
Alt+<number>   Switch to the <number>th view; number < maxViewNumber (see
options)
Alt+-   Display the view number; "ß" is the key next to "0" on a german
keyboard, on an US-keyboard the key is "-". This hotkey has to be
changed, if not using a german (latin1-de) keyboard.
Alt+0   Display a list of windows according to their tag (number)
Ctrl+Alt+<number>   Set <number> as the only tag of the active window;
number < maxViewNumber (see options)
Ctrl+Shift+Alt+<number>   Add <number> to the tags of the active windsow;
number < maxViewNumber (see options)
Win+<number>   Set the number of areas used to position the windows
Win+0   Set the number of areas to the number of windows on the active view
Win+<m/b/s/f>   Set the layout mode

    * m = mono or master (one window in a master area, the other in a
      stacking area)
    * b = bi (two windows in a splitted master area, the other in a
      stacking area)
    * s = stack (no master, all windows are in the stacking area)
    * f = fullscreen (no splitting, all windows are in fullscreen size;
      in effect this mode is like s1, but if the automatically resizing
      and positioning of windows is activated, the mode will not be
      changed, when a new window is opened.)

Win+<v/h>   Set the direction of the stacking area

    * v = vertical
    * h = horizontal

Win+<Down Arrow>   Decrease "splitRatio" by "splitRatioIncrement" and
resize and position all windows, if in master (b/m) mode; moves the
deviding line to the right or down.
Win+<Up Arrow>   Increase "splitRatio" by "splitRatioIncrement" and resize
and position all windows, if in master (b/m) mode; moves the deviding
line to the left or up
Win+Enter   Set the active window as the primary master
Win+g   Display the grid of the layout
Win+<Left Arrow>   Open the "Alt+Tab" menu, switching to the next window;
like Alt+Tab
Win+>Right Arrow>   Open the "Alt+Tab" menu, switching to the previous
window; like Alt+Shift+Tab
Win+c   Closing the active window
Win+t   Toggling the state of the taskbar (see option hideTaskbarFlag)
Ctrl+Shift+Win+e   Add/Replace the class of the active window to/from the
window management exceptions, causing windows with the given class not
to be handled by the window management functions.
Ctrl+Shift+Win+s   Opening the shortcut editor.
Win+Backspace   Reload the script
Win+Escape   Exit the script


Options
maxViewNumber   Maximum number of views/tags; the absolute maximum is 9
autoDisplayViewNumberFlag   If set to true, the view number is displayed
when switching the view.
OSDColor   The font and line color for the OSD (on screen display)
OSDOpacity   The opacity of the OSD (on screen display)
layoutMode   Default value for the layout mode

    * m = mono or master (one window in a master area, the other in a
      stacking area)
    * b = bi (two windows in a splitted master area, the other in a
      stacking area)
    * s = stack (no master, all windows are in the stacking area)
    * f = fullscreen (no splitting, all windows are in fullscreen size;
      in effect this mode is like s1, but if the automatically resizing
      and positioning of windows is activated, the mode will not be
      changed, when a new window is opened.)

numberOfAreas   The number of areas, in which the windows can be
positioned; e. g.

    * 1 with mode s: all windows are maximized
    * 2 with mode m or s: split screen
    * 5 with mode m: one window in the master area, 4 in the stacking area

splitLayout   the direction of the stacking area

    * v = vertical
    * h = horizontal

splitRatio   The ratio in which the current column or row will be split
(right to left column or upper to lower row) when the window is moved.
splitRatioIncrement   Increment by wich "splitRatio" is decreased or
increased when the master area is resized
hideTitlebarFlag   If set to true, the titlebar of all windows is hidden
leaving more space to the content.
hideTaskbarFlag   If set to true, the taskbar is hidden at start time (see
hotkey "Win+t" for toggling this option at run time).
autoResizeAndPositionWindowsFlag   If set to true, the number of areas is
automatically set to the number of windows and all windows are resized
and positioned accordingly; this action is triggered by opening or
closing a window.
autoDisplayLayoutGridFlag   If set to true, the layout grid is displayed,
when the layout is changed (by pressing Win+<m/b/s/v/h/<number>>)
exceptions   Classes of windows, which are excluded from the list of
windows and therefor are not resized and positioned or examined when
changing the view; there seem to be windows, which are not shown in the
taskbar (Shell_TrayWnd is obvious) and therefor have to be excluded from
the list of managed windows.
wmClassExceptions   Classes of windows, which are not accounted for the
window management.
wmTitleExceptions   Titles of windows, which are not accounted for the
window management.
startWithWindows   Automatically start dWm with Windows by setting a link
to the executable in the autostart menu.


Naturally I appreciate any bug reports Question , comments Very Happy Exclamation Evil or Very Mad or feature suggestions Idea .
Back to top
Joy2DWorld



Joined: 04 Dec 2006
Posts: 561
Location: Galil, Israel

PostPosted: Sat Jul 12, 2008 6:51 pm    Post subject: Reply with quote

nicely done.
small suggest, within lib. use only lib_ funct. names.

eg. window_management.ahk to windowm.ahk and all func windowm_this and windowm_that.
_________________
Joyce Jamce
Back to top
View user's profile Send private message
pomj



Joined: 22 Feb 2007
Posts: 7

PostPosted: Tue Jul 15, 2008 9:49 am    Post subject: Reply with quote

nice. I really like it (although I need a little adjustment Wink )

Great that you can remove the windowborders. It sometimes behaves a little unexpected. Don't know yet if it is me haveing to learn the behaviour or if it is a bug. I'll keep you posted.

one thing though. some applications do not behave very good in tiling mode so maybe a way to exclude some windows from the tiling (if that's possible)

once again. great program. I've missed the tiling soo much. Smile
Back to top
View user's profile Send private message
joten
Guest





PostPosted: Thu Jul 17, 2008 2:57 pm    Post subject: dWm - tested on Windows 98 Reply with quote

I have tested dWm on Windows 98 (VMware). It works - basically, but:
- To display the help without opening the HTML files in Internet Explorer you need an Internet Explorer version greater than 5.0; it was successfully tested with version 6.0. (bug)
- The OSD is flickering or just visible for less then a second. (bug)
- The OSD has no transparent, but white background. (minor bug)
- Hiding the titlebars does not work. (bug)
- Automatically resizing and positioning the windows does not work. (bug)
- The hotkeys "Win+m" and "Win+f" do not work as expected, because the explorer Win keys cannot be overridden. (bug)
- The hotkeys "Win+<left arrow>" and "Win+<left arrow>" do not work. (bug)

Test environment
Operating system: Windows 98 SE
Internet Explorer version: 5.0 (6.0 after the initial tests)
AutoHotkey version: 1.0.47.06
Screen resolution: 1024x768 (VMware)

download
dWm 0.5.5 (zip)

@Joy2DWorld: Thanks for your suggestion; I will consider it when making some more changes to the basic functions.
Actually, it is my first AHK script, thus there is not much pragramming style or techniques in it.

@pomj: The unexpected behaviour sounds like the bug I noticed in version 0.3.5 and 0.4.1; version 0.5.4 should solve the problem and allows to edit three exception lists:
(1) General exceptions: A list of classes like ShellTray_Wnd, which are just editable in the INI file
(2) Window management exceptions: A list of classes, which are editable in the INI file and addable over the hotkey Ctrl+Shift+Win+e
(3) Window management exceptions: A list of titles, which are editable in the INI file and addable over the hotkey Ctrl+Win+e
Back to top
krustyjonez



Joined: 17 Jul 2008
Posts: 2
Location: krustyjonez@gmail.com

PostPosted: Thu Jul 17, 2008 7:02 pm    Post subject: Reply with quote

I am a big fan of XMonad and Awesome on Unix desktops. I am thrilled and grateful you wrote this for Windows. It's fantastic.

Unfortunately, I can't replicate the tiled screenshot in the help documentation-where the main window is on the left & the other windows are stacked on the right.

In any mode of than the new fullscreen, I can't get the main window (the one with focus from Win-Enter) into Grid Box #1. #1 seems always reserved for the desktop.

Any ideas on how to make this work?

My specs : IBM Thinkpad T61p w/Nvidia Quadro FX, Vista x64 sp1, 4MB RAM. This happens whether or not I use the .exe or the .zip.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Joy2DWorld



Joined: 04 Dec 2006
Posts: 561
Location: Galil, Israel

PostPosted: Thu Jul 17, 2008 9:32 pm    Post subject: Reply with quote

if helpful,

note that *very* complex function set.

would make a trayicon rightclick accessible 'simple' feature set.
_________________
Joyce Jamce
Back to top
View user's profile Send private message
joten
Guest





PostPosted: Fri Jul 18, 2008 9:46 am    Post subject: Reply with quote

@krustyjonez
Your problem sounds familiar from the beginning of my testing. It looks like you have a window, which is always on top, but not visible; this can be a tooltip (easy case) or some application, which resides in the SysTray.
To deal with the problem, I need some more information:
(1) Have you enabled the automatically resizing and positioning of windows?
(2) When facing the problem, did you press Win+0 to reset the windows?
(3) How does it look like in "b" mode (pressing Win+b)?
(4) Did you use a version prior to 0.5.4 before?
(5) Please try to press Ctrl+Shift+Win+e when this ominous window is in the master area; this would add the window title to the according exception list assuming that this window is indeed active. If the stated title in the appearing message box does not look like a match, you can remove it from the exception list by pressing Ctrl+Shift+Win+e again.

Regards, Joerg
Back to top
krustyjonez



Joined: 17 Jul 2008
Posts: 2
Location: krustyjonez@gmail.com

PostPosted: Fri Jul 18, 2008 4:21 pm    Post subject: Reply with quote

Yes, I ran it from the first version you put up on here. Are there registry settings? I think it's using a new INI.
Back to top
View user's profile Send private message AIM Address MSN Messenger
joten
Guest





PostPosted: Fri Jul 18, 2008 6:27 pm    Post subject: Reply with quote

@krustyjonez
Version 0.5.4 is the first one, which explicitly uses an INI file. No version uses registry keys.
You may delete all files from %A_AppData%\dWm and run the latest version. But the most likely cause for your problem is a missing entry in the exception lists, which I did not consider, since the window in question did not pop up in my configurations.
Back to top
joten
Guest





PostPosted: Sun Jul 27, 2008 8:06 pm    Post subject: dWm - renamed to bug.n, fixed bugs, added new features Reply with quote

First I renamed the project to bug.n to avoid confusion with dwm from suckless.org (the capital w was not enough distinction in my opinion).
I did some bug fixing, especially to increase compatibility with legacy versions of Windows, and added some minor features.

download
dWm 0.5.8 (exe)
dWm 0.5.8 (zip)

comments
Since I renamed the project, the folder were renamed to; thus the old folders and links are no longer valid. Please delete the folder %A_AppData%\dWm with all its contents and the file %A_StartUp%\dWm.lnk.

new features - hotkeys
Ctrl+Shift+Win+a: Toggling the function "Automatically resize and position windows".
Ctrl+Shift+Win+h: Opening the about/help documents.
Ctrl+Shift+Win+i: Opening the INI file.
Ctrl+Shift+Win+o: Opening the options.
Ctrl+Shift+Win+s: Opening the shortcut editor.
Ctrl+Shift+Win+q: Showing a message box with the titles and classes of the windows on the active view, which are handled by the window management functions. With this information hints are given for the exception lists, if windows are not sized and positioned correctly.

new features - options
binocularLayoutModeHotkey: The key, which completes the hotkey to switch to the binocular layout mode.
fullscreenLayoutModeHotkey: The key, which completes the hotkey to switch to the full screen layout mode.
monocularLayoutModeHotkey: The key, which completes the hotkey to switch to the monocular layout mode.
stackingLayoutModeHotkey: The key, which completes the hotkey to switch to the stacking layout mode.
With these options it is possible to change the hotkeys for setting the layout mode; this avoids the conflicts with the already set Windows keys in Windows 98.

known bugs
General
* There is no support for multiple monitors. (no feature)

Windows Vista
* Bug: At least on one PC with Windows Vista the "Start" button is not hidden, when the taskbar is hidden and if not in full screen layout mode.

Windows XP
- no bugs

Windows 98
* Problem: The Internet Explorer cannot be embedded, therefor the help is not displayed in the appropriate window. Solution: Open the help files from the %A_AppData%\bugn directory in Internet Explorer or install an Internet Explorer version greater than 5.0; it was successfully tested with version 6.0.
* Bug: The OSD is flickering or just visible for less then a second.
* Bug (minor): The OSD has no transparent, but white background.
* Problem: Hiding the titlebars does not work. No solution possible: Windows 95/98/Me: The SetWindowLong function may fail if the window specified by the hWnd parameter does not belong to the same process as the calling thread. (http://msdn.microsoft.com/en-us/library/ms633591.aspx)
* Problem: Automatically resizing and positioning the windows does not work, when opening or closing a window. No solution possible: Minimum operating systems: Windows 2000 (http://msdn.microsoft.com/en-us/library/ms644989(VS.85).aspx)
* Problem: The hotkeys "Win+m", "Win+f", "Win+F1" and "Win+F3" do not work as expected, because the explorer Win keys cannot be overridden. Solution: Edit the options and set different keys for switching the layout mode.


@krustyjonez:
You might be interested in the hotkey "Ctrl+Shift+Win+q". If you find any title or classe in the list, which seems not to belong to any visible window, this could be the missing entry in one of the exception lists. Pease post any results.
Back to top
krustyjonez_guest
Guest





PostPosted: Tue Jul 29, 2008 5:44 am    Post subject: Reply with quote

Everything is working smooth as silk. Ctrl-Shft-Win-Q really helped. I identified that the Tablet Input Panel on Vista was taking up grid space #1. Once I eliminated that window class, everything is perfect.

Thanks for such an awesome application!
Back to top
joten
Guest





PostPosted: Thu Jul 31, 2008 10:14 am    Post subject: bug.n - website Reply with quote

I created a small website for this project Arrow http://freenet-homepage.de/bug.n/

Amongst others it provides an alternate download site for at least the latest version: bug.n - donwload
The first download site at filedropper.com is 'instable' since the pages and files are deleted after some time of inactivity.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group