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.
This commit is contained in:
Daniel Hahler 2015-02-03 12:45:30 +01:00
parent 7ae58b3208
commit fbc72624d7
1 changed files with 9 additions and 2 deletions

View File

@ -542,8 +542,15 @@ function client.movetoscreen(c, s)
s = sel.screen + 1 s = sel.screen + 1
end end
if s > sc then s = 1 elseif s < 1 then s = sc end if s > sc then s = 1 elseif s < 1 then s = sc end
sel.screen = s if sel.screen ~= s then
screen.focus(s) 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
end end