From e49b1de0b2968d6101857e2c336be0f7a2718281 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 28 Feb 2016 15:38:06 +0100 Subject: [PATCH] awful.tooltip: Some minor optimizations Signed-off-by: Uli Schlachter --- lib/awful/tooltip.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/awful/tooltip.lua b/lib/awful/tooltip.lua index 38eb84ad..ab520f12 100644 --- a/lib/awful/tooltip.lua +++ b/lib/awful/tooltip.lua @@ -65,7 +65,7 @@ local function get_wibox(self) -- Close the tooltip when clicking it. This gets done on release, to not -- emit the release event on an underlying object, e.g. the titlebar icon. - self.wibox:buttons(abutton({}, 1, nil, function() self.hide() end)) + self.wibox:buttons(abutton({}, 1, nil, self.hide)) end return self.wibox end @@ -75,14 +75,11 @@ end -- @tparam tooltip self A tooltip object. local function set_geometry(self) local wb = get_wibox(self) - local my_geo = wb:geometry() -- calculate width / height local n_w, n_h = self.textbox:get_preferred_size(mouse.screen) n_w = n_w + self.marginbox.left + self.marginbox.right n_h = n_h + self.marginbox.top + self.marginbox.bottom - if my_geo.width ~= n_w or my_geo.height ~= n_h then - wb:geometry({ width = n_w, height = n_h }) - end + wb:geometry({ width = n_w, height = n_h }) a_placement.next_to_mouse(wb) a_placement.no_offscreen(wb, mouse.screen) end