#474: remove remaining 9 warnings

This commit is contained in:
Luca CPZ 2020-11-30 14:58:27 +00:00
parent 9800eee039
commit 6b3bdcaed1
No known key found for this signature in database
GPG Key ID: 84687508EFC8F2ED
5 changed files with 29 additions and 30 deletions

View File

@ -25,9 +25,8 @@ helpers.scripts_dir = helpers.lain_dir .. 'scripts/'
-- {{{ Modules loader
function helpers.wrequire(table, key)
local module = rawget(table, key)
return module or require(table._NAME .. '.' .. key)
function helpers.wrequire(t, k)
return rawget(t, k) or require(t._NAME .. '.' .. k)
end
-- }}}

View File

@ -24,7 +24,7 @@ local function arrange(p, layout)
if #cls == 0 then return end
local c, g = cls[1], {}
local g = {}
-- Main column, fixed width and height
local mwfact = t.master_width_factor
@ -64,12 +64,12 @@ local function arrange(p, layout)
g.width = max(g.width, 1)
g.height = max(g.height, 1)
p.geometries[c] = g
p.geometries[cls[1]] = g
-- Auxiliary clients
if #cls <= 1 then return end
for i = 2, #cls do
local c, g = cls[i], {}
g = {}
local idxChecker, dimToAssign
local rowIndex = floor(i/2)
@ -121,7 +121,7 @@ local function arrange(p, layout)
g.width = max(g.width, 1)
g.height = max(g.height, 1)
p.geometries[c] = g
p.geometries[cls[i]] = g
end
end

View File

@ -241,7 +241,7 @@ local function do_fair(p, orientation)
local height = math.floor(wa.height / num_y[i])
local wy = wa.y
for _ = 0, (num_y[i]-2) do
local g = {}
g = {}
g.x = wx
g.y = wy
g.height = height
@ -252,7 +252,7 @@ local function do_fair(p, orientation)
nclient = nclient + 1
wy = wy + height
end
local g = {}
g = {}
g.x = wx
g.y = wy
g.height = wa.height - (num_y[i] - 1)*height

View File

@ -122,8 +122,22 @@ function quake:compute_size()
return self.geometry[self.screen.index]
end
function quake:new(config)
local conf = config or {}
function quake:toggle()
if self.followtag then self.screen = awful.screen.focused() end
local current_tag = self.screen.selected_tag
if current_tag and self.last_tag ~= current_tag and self.visible then
local c=self:display()
if c then
c:move_to_tag(current_tag)
end
else
self.visible = not self.visible
self:display()
end
end
function quake.new(conf)
conf = conf or {}
conf.app = conf.app or "xterm" -- application to spawn
conf.name = conf.name or "QuakeDD" -- window name
@ -162,18 +176,4 @@ function quake:new(config)
return dropdown
end
function quake:toggle()
if self.followtag then self.screen = awful.screen.focused() end
local current_tag = self.screen.selected_tag
if current_tag and self.last_tag ~= current_tag and self.visible then
local c=self:display()
if c then
c:move_to_tag(current_tag)
end
else
self.visible = not self.visible
self:display()
end
end
return setmetatable(quake, { __call = function(_, ...) return quake:new(...) end })
return setmetatable(quake, { __call = function(_, ...) return quake.new(...) end })

View File

@ -69,13 +69,13 @@ function separators.arrow_left(col1, col2)
widget.col1 = col1
widget.col2 = col2
widget.fit = function(_, _, _)
widget.fit = function(_, _, _)
return separators.width, separators.height
end
widget.update = function(col1, col2)
widget.col1 = col1
widget.col2 = col2
widget.update = function(c1, c2)
widget.col1 = c1
widget.col2 = c2
widget:emit_signal("widget::redraw_needed")
end