The tooltip might be partly outside of the screen, and especially the
workarea, e.g. for tooltips on the tasklist.
Calling `awful.placement.no_offscreen` makes sure that it is fully
inside, and will even restrict it to the workarea, not only to the screen.
Closes https://github.com/awesomeWM/awesome/pull/409.
This table contains the drawable, wibox and titlebar that we are drawing on, but
also includes the screen and the DPI of that screen. This allows widgets to
depend on the DPI in their rendering.
Signed-off-by: Uli Schlachter <psychon@znc.in>
With the second argument being 2, the traceback will not include the error
handling function, but instead end at the actual place of the error.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds gears.timer.start(timeout, callback) that creates a timer object and
connects a callback to it, all in one go.
Additionally, this adds gears.timer.weak_start(timeout, callback). The weak
version still allows the callback function to be garbage collected and will then
stop the timer.
This was tested with the following code:
require("gears.timer").start(0.3, function()
print("ping")
if collectgarbage("step", 500) then
print("collection done")
error("err")
end
return true end)
require("gears.timer").weak_start(0.1, function()
io.stdout:write(".")
return true
end)
After a full collection cycle, both timers are stopped. The first one is stopped
because of the error() that it generated. The second one is stopped because the
callback function was garbage collected.
Ref: https://github.com/awesomeWM/awesome/issues/216
Signed-off-by: Uli Schlachter <psychon@znc.in>
I'm working on something that adds :layout functions to widgets. This clashes
with the keyboardlayout widget's use of an entry with this name. This change
adds an underscore as a prefix to the private data members of the
keyboardlayout.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Given an outcome of e.g. 1.01 its more sane to use 1 than 2, especially
for `border_width`.
This uses the method from `wibox.layout.flex`.
Closes https://github.com/awesomeWM/awesome/pull/389.
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 splits the logic for `delay_show` out of `show`/`hide`, and handles
an already stopped timer. The timer gets also stopped after the tooltip
has been displayed.
Ref: https://github.com/awesomeWM/awesome/issues/371.
Use `beautiful.xresources.apply_dpi` for `common.list_update`'s textbox
margins, and add a left margin for the imagebox, too.
The latter is useful/nicer with the default behavior of an inverted
style for the focused tasklist entry.