diff options
| author | crecher <crecher@crecher.net> | 2026-10-26 00:33:34 +0000 |
|---|---|---|
| committer | crecher <crecher@crecher.net> | 2026-10-26 00:33:34 +0000 |
| commit | 5bc90e2b8b6d22e755797182c5d3b2f22cb62f63 (patch) | |
| tree | 8860a5e48a35be0bd78fb665f43dc9f88f2fa343 /main.go | |
| parent | 1db9b13964082042a9578d372723777273c50daa (diff) | |
| download | wm-5bc90e2b8b6d22e755797182c5d3b2f22cb62f63.tar.gz wm-5bc90e2b8b6d22e755797182c5d3b2f22cb62f63.zip | |
feat: zoom
Signed-off-by: crecher <crecher@crecher.net>
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": |