Merge pull request #979 from Elv13/mix_fix

Misc fixes
This commit is contained in:
Daniel Hahler 2016-06-27 19:29:08 +02:00 committed by GitHub
commit 0c909e8d31
2 changed files with 19 additions and 12 deletions

View File

@ -198,19 +198,25 @@ function layout.getname(_layout)
return _layout.name return _layout.name
end end
local function arrange_prop_nf(obj)
if not client.object.get_floating(obj) then
layout.arrange(obj.screen)
end
end
local function arrange_prop(obj) layout.arrange(obj.screen) end local function arrange_prop(obj) layout.arrange(obj.screen) end
capi.client.connect_signal("property::size_hints_honor", arrange_prop) capi.client.connect_signal("property::size_hints_honor", arrange_prop_nf)
capi.client.connect_signal("property::struts", arrange_prop) capi.client.connect_signal("property::struts", arrange_prop)
capi.client.connect_signal("property::minimized", arrange_prop) capi.client.connect_signal("property::minimized", arrange_prop_nf)
capi.client.connect_signal("property::sticky", arrange_prop) capi.client.connect_signal("property::sticky", arrange_prop_nf)
capi.client.connect_signal("property::fullscreen", arrange_prop) capi.client.connect_signal("property::fullscreen", arrange_prop_nf)
capi.client.connect_signal("property::maximized_horizontal", arrange_prop) capi.client.connect_signal("property::maximized_horizontal", arrange_prop_nf)
capi.client.connect_signal("property::maximized_vertical", arrange_prop) capi.client.connect_signal("property::maximized_vertical", arrange_prop_nf)
capi.client.connect_signal("property::border_width", arrange_prop) capi.client.connect_signal("property::border_width", arrange_prop_nf)
capi.client.connect_signal("property::hidden", arrange_prop) capi.client.connect_signal("property::hidden", arrange_prop_nf)
capi.client.connect_signal("property::floating", arrange_prop) capi.client.connect_signal("property::floating", arrange_prop)
capi.client.connect_signal("property::geometry", arrange_prop) capi.client.connect_signal("property::geometry", arrange_prop_nf)
capi.client.connect_signal("property::screen", function(c, old_screen) capi.client.connect_signal("property::screen", function(c, old_screen)
if old_screen then if old_screen then
layout.arrange(old_screen) layout.arrange(old_screen)

View File

@ -218,16 +218,17 @@ function mouse.resize_handler(c, context, hints)
if hints and context and context:find("mouse.*") then if hints and context and context:find("mouse.*") then
-- This handler only handle the floating clients. If the client is tiled, -- This handler only handle the floating clients. If the client is tiled,
-- then it let the layouts handle it. -- then it let the layouts handle it.
local lay = c.screen.selected_tag.layout local t = c.screen.selected_tag
local lay = t and t.layout or nil
if lay == layout.suit.floating or c.floating then if (lay and lay == layout.suit.floating) or c.floating then
c:geometry { c:geometry {
x = hints.x, x = hints.x,
y = hints.y, y = hints.y,
width = hints.width, width = hints.width,
height = hints.height, height = hints.height,
} }
elseif lay.resize_handler then elseif lay and lay.resize_handler then
lay.resize_handler(c, context, hints) lay.resize_handler(c, context, hints)
end end
end end