diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -446,6 +446,28 @@ func moveToTag(conn *xgb.Conn, tags BitMask) { drawBar(conn) } +func zoom(conn *xgb.Conn) { + var tiled []*Client + for _, c := range ActiveClients { + if !c.Floating { + tiled = append(tiled, c) + } + } + c, ok := clients[focused] + if !ok || c.Floating || len(tiled) < 2 { + return + } + if c == tiled[0] { + c = tiled[1] + } + removeClient(c.Win) + clientList = append([]*Client{c}, clientList...) + focused = c.Win + setInputFocus(conn, focused) + updateWindows(conn) + drawBar(conn) +} + func toggleView(conn *xgb.Conn, tags BitMask) { view := GlobalTags ^ tags if view == 0 { @@ -1113,6 +1135,8 @@ func parseAction(s string) (func(*xgb.Conn), error) { return func(*xgb.Conn) { quit() }, nil case "restart": return func(*xgb.Conn) { restart() }, nil + case "zoom": + return zoom, nil case "kill": return func(conn *xgb.Conn) { killActiveWindow(conn, focused) }, nil case "layout": |