From fbc72624d7cd8bc7a96d4a261e0f281be5614375 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 3 Feb 2015 12:45:30 +0100 Subject: [PATCH] Activate focused client with `awful.client.movetoscreen` The default config has this: awful.key({ modkey, }, "o", awful.client.movetoscreen ), This moves the client to the next screen and focuses that screen. But it does not ensure that the client is raised above any existing windows, e.g. when moving a floating client. This patch emits the `request::activate` signal if the client is currently focused, but only if the screen property actually has changed. Closes https://github.com/awesomeWM/awesome/pull/98. --- lib/awful/client.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/awful/client.lua b/lib/awful/client.lua index ca32b0cfc..17a0a8256 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -542,8 +542,15 @@ function client.movetoscreen(c, s) s = sel.screen + 1 end if s > sc then s = 1 elseif s < 1 then s = sc end - sel.screen = s - screen.focus(s) + if sel.screen ~= s then + local sel_is_focused = sel == capi.client.focus + sel.screen = s + screen.focus(s) + + if sel_is_focused then + sel:emit_signal("request::activate", "client.movetoscreen") + end + end end end