awful.tooltip: do not hide when entering its wibox

Because of `placement.under_mouse` (and without
`placement.no_offscreen` fixing it), this will cause the tooltip to hide
immediately again.

There is no need for hooking into this signal, but this adds a click
handler to close the tooltip when clicking into it.
This commit is contained in:
Daniel Hahler 2015-07-29 20:59:43 +02:00
parent a8d224ef5c
commit 14e63fbcd7
1 changed files with 4 additions and 2 deletions

View File

@ -45,6 +45,7 @@ local screen = screen
local timer = require("gears.timer")
local wibox = require("wibox")
local a_placement = require("awful.placement")
local abutton = require("awful.button")
local beautiful = require("beautiful")
local textbox = require("wibox.widget.textbox")
local background = require("wibox.widget.background")
@ -270,8 +271,9 @@ tooltip.new = function(args)
self.marginbox = wibox.layout.margin(self.background, m_lr, m_lr, m_tb, m_tb)
self.wibox:set_widget(self.marginbox)
-- add some signals on both the tooltip and widget
self.wibox:connect_signal("mouse::enter", data[self].hide)
-- 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() data[self].hide() end))
-- Add tooltip to objects
if args.objects then