diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-06-13 10:30:56 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-06-13 10:30:56 +0200 |
commit | 0ded3ecd3bb65b37602e2ad06d657b47dd3025e7 (patch) | |
tree | 58e00ab1a6d567b9e777a93482e0fd10b9c9d306 /bindings.lua | |
parent | 044a445cdc2f25f9f069eb95113812cd19f1c0fe (diff) |
workspace: avoid unnecessary page stealing
When switching to a different desktop, the current code would use the
last-used tag even if it is currently displayed. Instead, keep a
per-desktop stack of free tags and pick the first of those.
Diffstat (limited to 'bindings.lua')
-rw-r--r-- | bindings.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bindings.lua b/bindings.lua index 0379525..c9261ca 100644 --- a/bindings.lua +++ b/bindings.lua @@ -89,7 +89,7 @@ function M.create(workspace) mypromptbox[mouse.screen].widget, function(input) if input then - local cur_desk = workspace.screen_state[mouse.screen].desktop + local cur_desk = workspace.screen_state[mouse.screen].desktop_idx workspace:rename_desktop(cur_desk, input) end end) @@ -109,7 +109,7 @@ function M.create(workspace) local state = workspace.screen_state[screen] local desk = 1 if state then - desk = state.desktop + desk = state.desktop_idx end workspace:view(screen, desk, i) @@ -119,7 +119,7 @@ function M.create(workspace) function () if client.focus then local c = client.focus - workspace:move_client(c, workspace.screen_state[c.screen].desktop, i) + workspace:move_client(c, workspace.screen_state[c.screen].desktop_idx, i) end end)) end @@ -137,7 +137,7 @@ function M.create(workspace) function () if client.focus then local c = client.focus - workspace:move_client(c, workspace.screen_state[c.screen].desktop, i) + workspace:move_client(c, workspace.screen_state[c.screen].desktop_idx, i) end end)) end |