#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 -- {{{ Modules loader
function helpers.wrequire(table, key) function helpers.wrequire(t, k)
local module = rawget(table, key) return rawget(t, k) or require(t._NAME .. '.' .. k)
return module or require(table._NAME .. '.' .. key)
end end
-- }}} -- }}}

View File

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

View File

@ -241,7 +241,7 @@ local function do_fair(p, orientation)
local height = math.floor(wa.height / num_y[i]) local height = math.floor(wa.height / num_y[i])
local wy = wa.y local wy = wa.y
for _ = 0, (num_y[i]-2) do for _ = 0, (num_y[i]-2) do
local g = {} g = {}
g.x = wx g.x = wx
g.y = wy g.y = wy
g.height = height g.height = height
@ -252,7 +252,7 @@ local function do_fair(p, orientation)
nclient = nclient + 1 nclient = nclient + 1
wy = wy + height wy = wy + height
end end
local g = {} g = {}
g.x = wx g.x = wx
g.y = wy g.y = wy
g.height = wa.height - (num_y[i] - 1)*height 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] return self.geometry[self.screen.index]
end end
function quake:new(config) function quake:toggle()
local conf = config or {} 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.app = conf.app or "xterm" -- application to spawn
conf.name = conf.name or "QuakeDD" -- window name conf.name = conf.name or "QuakeDD" -- window name
@ -162,18 +176,4 @@ function quake:new(config)
return dropdown return dropdown
end end
function quake:toggle() return setmetatable(quake, { __call = function(_, ...) return quake.new(...) end })
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 })

View File

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