From 0ded3ecd3bb65b37602e2ad06d657b47dd3025e7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 13 Jun 2020 10:30:56 +0200 Subject: 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. --- bindings.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bindings.lua') 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 -- cgit v1.2.3