From 3bb50dbe15800900945f92e39f0721f5d6632b60 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 25 Feb 2021 17:58:31 +0100 Subject: bindings: try to preserve the screen during various moves --- bindings.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bindings.lua b/bindings.lua index 5c32d05..1959d9e 100644 --- a/bindings.lua +++ b/bindings.lua @@ -94,14 +94,18 @@ function M.create(workspace) function () if client.focus then local c = client.focus + local s = c.screen workspace:client_move_relative(c, 1) + timer.delayed_call(awful.screen.focus, s) end end), awful.key({ modkey, "Shift" }, "k", function () if client.focus then local c = client.focus + local s = c.screen workspace:client_move_relative(c, -1) + timer.delayed_call(awful.screen.focus, s) end end), @@ -178,7 +182,9 @@ function M.create(workspace) function () if client.focus then local c = client.focus - workspace:move_client(c, workspace.screen_state[c.screen].desktop_idx, i) + local s = c.screen + workspace:move_client(c, workspace.screen_state[s].desktop_idx, i) + timer.delayed_call(awful.screen.focus, s) end end)) end @@ -217,9 +223,11 @@ function M.create(workspace) function () if client.focus then local c = client.focus + local s = c.screen local desk = workspace.desktops[i] local page_idx = desk:find_empty_page() or 1 workspace:move_client(c, i, page_idx) + timer.delayed_call(awful.screen.focus, s) end end)) end -- cgit v1.2.3