Patch awful.layout to avoid swapping client order in machi layouts, which causes flooding of client signals.
This should fix #18.
This commit is contained in:
parent
958f989e58
commit
3b3fcd82d7
26
layout.lua
26
layout.lua
|
@ -3,7 +3,9 @@ local machi_editor = require(this_package.."editor")
|
|||
local awful = require("awful")
|
||||
local gobject = require("gears.object")
|
||||
local capi = {
|
||||
screen = screen
|
||||
screen = screen,
|
||||
client = client,
|
||||
mouse = mouse,
|
||||
}
|
||||
|
||||
local ERROR = 2
|
||||
|
@ -627,4 +629,26 @@ function module.placement.empty_then_fair(c, instance, areas, geometry)
|
|||
empty_then_maybe_fair(c, instance, areas, geometry, true)
|
||||
end
|
||||
|
||||
local function patch_awful_layout()
|
||||
local old_alayout_move_handler = awful.layout.move_handler
|
||||
if old_alayout_move_handler == nil then return end
|
||||
-- Mostly the original one but does not swap clients in machi layouts.
|
||||
function awful.layout.move_handler(c, context, ...)
|
||||
if not c.floating and context == "mouse.move" then
|
||||
local s = capi.mouse.screen
|
||||
if s.selected_tag and s.selected_tag.layout and
|
||||
s.selected_tag.layout.machi_set_cmd then
|
||||
if c.screen ~= s then
|
||||
c.screen = s
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
return old_alayout_move_handler(c, context, ...)
|
||||
end
|
||||
capi.client.disconnect_signal("request::geometry", old_alayout_move_handler)
|
||||
capi.client.connect_signal("request::geometry", awful.layout.move_handler)
|
||||
end
|
||||
patch_awful_layout()
|
||||
|
||||
return module
|
||||
|
|
Loading…
Reference in New Issue