rc.lua: Fix titlebar button events (FS#1116)
Due to some layout changes, the client title widget is no longer assigned all the remaining space. To work around this, we wrap the widget in a flex layout which means that it asks for all the available space. This way, moving via the titlebar works again. Additionally, these button events are now also assigned to the client's icon widget. No idea why this wasn't done before... Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
bc1507f96d
commit
9d5e2a981a
|
@ -386,21 +386,8 @@ client.connect_signal("manage", function (c, startup)
|
|||
|
||||
local titlebars_enabled = false
|
||||
if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
|
||||
-- Widgets that are aligned to the left
|
||||
local left_layout = wibox.layout.fixed.horizontal()
|
||||
left_layout:add(awful.titlebar.widget.iconwidget(c))
|
||||
|
||||
-- Widgets that are aligned to the right
|
||||
local right_layout = wibox.layout.fixed.horizontal()
|
||||
right_layout:add(awful.titlebar.widget.floatingbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.maximizedbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.stickybutton(c))
|
||||
right_layout:add(awful.titlebar.widget.ontopbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.closebutton(c))
|
||||
|
||||
-- The title goes in the middle
|
||||
local title = awful.titlebar.widget.titlewidget(c)
|
||||
title:buttons(awful.util.table.join(
|
||||
-- buttons for the titlebar
|
||||
local buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
|
@ -411,13 +398,33 @@ client.connect_signal("manage", function (c, startup)
|
|||
c:raise()
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
))
|
||||
)
|
||||
|
||||
-- Widgets that are aligned to the left
|
||||
local left_layout = wibox.layout.fixed.horizontal()
|
||||
left_layout:add(awful.titlebar.widget.iconwidget(c))
|
||||
left_layout:buttons(buttons)
|
||||
|
||||
-- Widgets that are aligned to the right
|
||||
local right_layout = wibox.layout.fixed.horizontal()
|
||||
right_layout:add(awful.titlebar.widget.floatingbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.maximizedbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.stickybutton(c))
|
||||
right_layout:add(awful.titlebar.widget.ontopbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.closebutton(c))
|
||||
|
||||
-- The title goes in the middle
|
||||
local middle_layout = wibox.layout.flex.horizontal()
|
||||
local title = awful.titlebar.widget.titlewidget(c)
|
||||
title:set_align("center")
|
||||
middle_layout:add(title)
|
||||
middle_layout:buttons(buttons)
|
||||
|
||||
-- Now bring it all together
|
||||
local layout = wibox.layout.align.horizontal()
|
||||
layout:set_left(left_layout)
|
||||
layout:set_right(right_layout)
|
||||
layout:set_middle(title)
|
||||
layout:set_middle(middle_layout)
|
||||
|
||||
awful.titlebar(c):set_widget(layout)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue