Added multimonitor support to scratchpad

This commit is contained in:
Gokul Swami 2021-04-08 17:44:03 -07:00
parent da886cb1c4
commit ce03607975
1 changed files with 14 additions and 11 deletions

View File

@ -2,7 +2,6 @@ local awful = require("awful")
local helpers = require(tostring(...):match(".*bling") .. ".helpers")
local Scratchpad = {}
--- Creates a new scratchpad object based on the argument
@ -19,9 +18,7 @@ end
--- Find all clients that satisfy the the rule
--
-- @return A list of all clients that satisfy the rule
function Scratchpad:find()
return helpers.client.find(self.rule)
end
function Scratchpad:find() return helpers.client.find(self.rule) end
--- Applies the objects scratchpad properties to a given client
--
@ -30,7 +27,12 @@ function Scratchpad:apply(c)
if not c or not c.valid then return end
c.floating = self.floating
c.sticky = self.sticky
c:geometry(self.geometry)
c:geometry({
x = self.geometry.x + awful.screen.focused().geometry.x,
y = self.geometry.y + awful.screen.focused().geometry.y,
width = self.geometry.width,
height = self.geometry.height
})
if self.autoclose then
c:connect_signal("unfocus", function(c)
c.sticky = false -- client won't turn off if sticky
@ -82,7 +84,8 @@ function Scratchpad:toggle()
is_turn_off = matches[1].first_tag.selected
end
else
is_turn_off = client.focus and awful.rules.match(client.focus, self.rule)
is_turn_off = client.focus and
awful.rules.match(client.focus, self.rule)
end
if is_turn_off then