awful.tooltip: Inline place() into set_geometry()

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-02-28 14:43:40 +01:00
parent f9d15691b8
commit 1578957355
1 changed files with 2 additions and 12 deletions

View File

@ -58,13 +58,6 @@ local ipairs = ipairs
-- @tfield boolean visible True if tooltip is visible.
local tooltip = { mt = {} }
-- Place the tooltip on the screen.
-- @tparam tooltip self A tooltip object.
local function place(self)
a_placement.next_to_mouse(self.wibox)
a_placement.no_offscreen(self.wibox, mouse.screen)
end
-- Place the tooltip under the mouse.
--
-- @tparam tooltip self A tooltip object.
@ -77,6 +70,8 @@ local function set_geometry(self)
if my_geo.width ~= n_w or my_geo.height ~= n_h then
self.wibox:geometry({ width = n_w, height = n_h })
end
a_placement.next_to_mouse(self.wibox)
a_placement.no_offscreen(self.wibox, mouse.screen)
end
-- Show a tooltip.
@ -92,7 +87,6 @@ local function show(self)
end
end
set_geometry(self)
place(self)
self.wibox.visible = true
self.visible = true
end
@ -263,10 +257,6 @@ tooltip.new = function(args)
-- emit the release event on an underlying object, e.g. the titlebar icon.
self.wibox:buttons(abutton({}, 1, nil, function() self.hide() end))
-- Re-place when the geometry of the wibox changes.
self.wibox:connect_signal("property::width", function() place(self) end)
self.wibox:connect_signal("property::height", function() place(self) end)
-- Add tooltip to objects
if args.objects then
for _, object in ipairs(args.objects) do