The goal is to catch cases where the return value exists, but is
forgotten. There was a large enough number of them to turn this
into a real check. Initially, I just wanted to implement it to fix
the problems, then delete the code. But since this is so common, I
think it is worth the annoyance.
The default `rc.lua` was using the focus/unfocus signals to set
the border color along with `awful.rules`. This logic block was
no longer aligned with the rest of `rc.lua` since it was
the only place where `beautiful` variables where only used by
`rc.lua`.
On top of this, the new request handler also has extra contexts
for the urgent and floating/maximixed use cases. So it can be used
by themes to implement much smarter borders than just focus based
ones. They were previously limited by the fact most of the
(un-monkey-patchable) logic was in `rc.lua`.
Note that this commit also shuffle the awful.rules order between
the titlebar and the border and changes the tests accordignly.
After some consideration, I came to the conclusion the previous
behavior was bogus and the fact that the placement tests required
to know about the titlebar height is simply a proof of that. The
change was required in this commit because since the border is no
longer in the default rules, a new buggy edge case surfaced.
This way their name doesn't get mangle by the broken magic. It will also
eventually allow to `error()` in the template when the implicit
`@function` is used.
This commit also fixes a large number of issues found while
proof-reading everything.
Commit ac8af66005 added beautiful.theme_path, which is used to save the
directory that contains the theme file that was loaded. Just two months
later, commit ca12473584 broke this code by adding a __newindex
metamethod. This caused the assignment to beautiful.theme_path to be
redirected to the theme. However, the theme is immediately replaced by
beautiful.init() after setting up the theme_path, so this assignment got
lost.
Fix this by using rawset() to bypass the metamethod.
Fixes: https://github.com/awesomeWM/awesome/issues/2573
Signed-off-by: Uli Schlachter <psychon@znc.in>
Given they are all small, it makes more sense to just merge them like
we did for the client API
For some reasons GTK doesn't want to be merged. To be investigated.
As long as Awesome provides APIs that uses pixels are points, this
cannot be enabled by default.
For example, a wibar size defined in pixels may be too small to
render the text once a dense display is connected.
Once upon a time, beautiful.xresources.get_dpi was added to query
Xft.dpi. That made sense since this queried an xresources property. Over
time, other, non-xresources-based ways to query DPI were added to this
function. Now, it makes no more sense to have this function here.
Also, recently it became possible to add new properties to C objects
from Lua code. Thus, we no longer need to have a get_dpi() function
somewhere, but can add s.dpi directly.
Thus, this commit adds s.dpi and makes everything use it. No functional
changes are intended.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Without this, users would modify the beautiful table directly instead of
the theme. This made a difference for code using beautiful.get() to get
the theme.
Reference: https://github.com/awesomeWM/awesome/pull/1854
Signed-off-by: Uli Schlachter <psychon@znc.in>
* Move table functions out of awful.util into new gears.table
* travis: Use v9999 prefix for full requests
Make sure no newly deprecated functions are used
* Move all `awful.util.table.*` calls to `gears.table.*` calls
Move table test functions from awful/util_spec to new gears/table_spec
Change awful.util.subsets call to gears.math.subsets in awful/key.lua
As documented in
<https://keithp.com/~keithp/talks/xtc2001/paper/xft.html#sec-editing>,
the fallback value for Xft.dpi should be the vertical DPI reported by X.
On Xorg, this will generally be 96, unless the user has overridden the
value by either forcing Xorg to report the EDID-derived DPI, or by
setting the DPI themselves (via configuration, command line, or xrandr).
The 96 value is kept as ultimate fallback if anything goes wrong.
Commit c50d62749b added an empty table as a default theme. However,
when loading the actual theme fails, we will end up with theme having
value nil. This commit fixes this by reverting back to an empty table.
Fixes: https://github.com/awesomeWM/awesome/issues/1417
Signed-off-by: Uli Schlachter <psychon@znc.in>
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.
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.
This adds an optional screen argument to get_dpi/apply_dpi and set_dpi
to store DPI values per screen.
This can be used in your config to manage different DPI values for an
internal and external display:
beautiful.xresources.set_dpi(125, 1)
beautiful.xresources.set_dpi(94, 2)
This is meant to be the foundation for more evolved DPI handling in
awesome.
Closes https://github.com/awesomeWM/awesome/pull/336.
This is meant to get a new font (copy) with adjusted attributes, e.g.
font_focus = beautiful.get_font_copy(theme.font, "bold")
Closes https://github.com/awesomeWM/awesome/pull/308.