added feature: set the position for a new window on the view especially in tiled

layout (not only "first in the master area, but also last in the
               master, first or last in the stack area): Config_newWndPostition
This commit is contained in:
joten 2012-06-08 12:00:02 +02:00
parent ad0c3bcaa2
commit 95b66c4255
2 changed files with 22 additions and 2 deletions

View File

@ -61,6 +61,7 @@ Config_init() {
Config_layoutMFactor := 0.6 ; The factor for the size of the master area, which is multiplied by the monitor size.
Config_mouseFollowsFocus := True ; If true, the mouse pointer is set over the focused window, if a window is activated by bug.n.
Config_onActiveHiddenWnds := "view" ; The action, which will be taken, if a window e. g. should be activated, but is not visible; "view": show the view accordng to the first tag of the window in question, "tag": add the window in question to the current visible view, "hide": hide the window again ignoring the activation.
Config_newWndPosition := "top" ; The position of a new window in a view; "top": at the beginning of the window list and the master area (default), "masterBottom": at the end of the master area, "stackTop": on top of the stack area, "bottom": at the end of the window list and the stack area.
Config_shellMsgDelay := 350 ; The time bug.n waits after a shell message (a window is opened, closed or the focus has been changed); if there are any problems recognizing, when windows are opened or closed, try to increase this number.
Config_syncMonitorViews := 0 ; The number of monitors (2 or more), for which views should be activated, when using the accordant hotkey. If set to 1, the views are actiated for all monitors. If set to 0, views are activated independently (only on the active monitor).
Config_viewFollowsTagged := False ; If true and a window is tagged with a single tag, the view is correspondingly set to the tag.

View File

@ -261,7 +261,8 @@ Manager_loop(index, increment, lowerBound, upperBound) {
}
Manager_manage(wndId) {
Local a, c0, hideTitle, isDecorated, isFloating, isManaged, m, tags, wndControlList0, wndX, wndY, wndWidth, wndHeight, wndProcessName
Local a, c0, hideTitle, i, isDecorated, isFloating, isManaged, l, m, n, replace, search, tags
Local wndControlList0, wndId0, wndIds, wndX, wndY, wndWidth, wndHeight, wndProcessName
If Not InStr(Manager_allWndIds, wndId ";")
Manager_allWndIds .= wndId ";"
@ -285,7 +286,25 @@ Manager_manage(wndId) {
Loop, % Config_viewCount
If (Manager_#%wndId%_tags & 1 << A_Index - 1) {
View_#%m%_#%A_Index%_wndIds := wndId ";" View_#%m%_#%A_Index%_wndIds
l := View_#%m%_#%A_Index%_layout_#1
If (Config_layoutFunction_#%l% = "tile") And ((Config_newWndPosition = "masterBottom") Or (Config_newWndPosition = "stackTop")) {
n := View_getTiledWndIds(m, A_Index, wndIds)
If (n > 1) {
StringSplit, wndId, wndIds, `;
If (wndId0 < View_#%m%_#%A_Index%_layoutMSplit)
View_#%m%_#%A_Index%_layoutMSplit := wndId0
i := View_#%m%_#%A_Index%_layoutMSplit
search := wndId%i% ";"
replace := search wndId ";"
StringReplace, View_#%m%_#%A_Index%_wndIds, View_#%m%_#%A_Index%_wndIds, %search%, %replace%
} Else
View_#%m%_#%A_Index%_wndIds .= wndId ";"
If (Config_newWndPosition = "masterBottom") And (n > 0)
View_#%m%_#%A_Index%_layoutMSplit += 1
} Else If (Config_newWndPosition = "bottom")
View_#%m%_#%A_Index%_wndIds .= wndId ";"
Else
View_#%m%_#%A_Index%_wndIds := wndId ";" View_#%m%_#%A_Index%_wndIds
Bar_updateView(m, A_Index)
}