Default config: Unify mouse dragging behavior (#2278)

* Default config: Unify mouse dragging behavior

When moving or resizing a client by dragging its titlebar with mouse,
the client is automatically focused and raised. However, this behavior
is not replicated by tne other dragging method, i.e. grabbing it with
mouse while pressing the modkey. Sometimes, this causes a client to
disappear below another one while moving.

This commit unifies handling of dragging clients with mouse, by ensuring
that the client is focused and raised, whichever dragging method is
used. The fix applies both to moving and resizing clients.

Signed-off-by: Piotr Śliwka <contact@psliwka.info>

* Default config: Fix clientbuttons style

This commit unifies code style of click handling functions defined in
`clientbuttons` table, to match the style introduced in a228696.

Signed-off-by: Piotr Śliwka <contact@psliwka.info>
This commit is contained in:
Piotr Śliwka 2018-06-10 01:35:08 +02:00 committed by Yauhen Kirylau
parent 7e529eeab2
commit dc8229fd5a
1 changed files with 15 additions and 3 deletions

View File

@ -458,9 +458,21 @@ end
-- @DOC_CLIENT_BUTTONS@ -- @DOC_CLIENT_BUTTONS@
clientbuttons = gears.table.join( clientbuttons = gears.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ }, 1, function (c)
awful.button({ modkey }, 1, awful.mouse.client.move), client.focus = c;
awful.button({ modkey }, 3, awful.mouse.client.resize)) c:raise()
end),
awful.button({ modkey }, 1, function (c)
client.focus = c
c:raise()
awful.mouse.client.move(c)
end),
awful.button({ modkey }, 3, function (c)
client.focus = c
c:raise()
awful.mouse.client.resize(c)
end)
)
-- Set keys -- Set keys
root.keys(globalkeys) root.keys(globalkeys)