awesome/tests
Alex Belykh f3bd13da87 Undo some controversial changes
User should be DISCOURAGED from accessing the graph object
in drawing callbacks and encouraged to use the values from
the context instead, which are for many reasons more actual
and reliable than seemingly similar graph properties.

Which is why graph should be at least as hard to access as them,
which is why graph belongs into options/context, and not as
a self parameter. And since there can be no "self" parameter,
the last semblance of analogy to signals/callbacks is moot, and
the context parameter should be moved back to the last place,
where it belongs due to its low usefulness.

Things like step_width though, which are of direct immediate
use for 99.9% of callbacks, should be elevated to parameters,
EVEN if they were the same thing as graph properties.

And when merging context into options via __index metatable, one
should separately document the context first and link to its
documentation, instead of appending an ad-hoc list of its fields,
which can get obsolete.

Which is also incidentally another reason why the options table
should have fields starting with underscores - to not accidentally
shadow a newly introduced context field, however unlikely that is.

Properties, whose getters return a value different from
what the setter was last called with, are usually too much magic
and cognitive overload, than it's worth.

Returning a different "default value" on nil can hide issues and
make user blame the widget, in case they set the property to nil
as a result of their failed computation, which they thought to
produce a non-nil result, different from the "default value".
And as a developer, one has to constantly remember, which
properties and where should be accessed directly and where
through the magic getter, because it's suddenly not the same thing.

In short, anything that is accessed through [],
i.e. looks like data, should behave like plain data.
Otherwise it should be accessed through a function,
which it really is.

If one wants some defaults consistently applied
everywhere it should be done with a helper function,
that should be called everywhere, and not with a property
access, which is harder to find, EVEN IF the property is
magic and does the same thing. It should be then just
implemented by delegating to the helper function.

But most properties with defaults are used in the
graph widget code only once, so neither magic properties nor
helper functions are warranted.

If one still wants, that some properties never return
nil, then they should be populated in the constructor and
forbidden to be set to nil ever by a validating setter.
2021-05-22 03:37:05 +07:00
..
examples Undo some controversial changes 2021-05-22 03:37:05 +07:00
themes cmake: pass DO_COVERAGE=1 in env for tests/run.sh (#2575) 2019-01-11 17:04:23 +01:00
_client.lua Rename Lua executable envvar 2021-03-23 09:10:07 +01:00
_multi_screen.lua Add a new disposition to _multi_screen.lua 2017-05-15 08:15:59 +02:00
_runner.lua Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
_wibox_helper.lua tests: Stop using the legacy layoutbox constructor. 2019-10-05 22:57:05 -04:00
run.sh cmd: Add an option to force the command line arguments. 2020-02-08 17:12:56 -05:00
test-awesomerc.lua convert hotkeys_popup to awful.popup instead of wibox 2020-03-19 10:51:51 -05:00
test-awful-client.lua Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
test-awful-layout.lua Re-arrange the magnifier layout on focus changes 2017-06-09 10:13:14 +02:00
test-awful-placement.lua Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
test-awful-rules.lua Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
test-awful-screen.lua tests: Test the screen name. 2019-09-30 00:49:40 -04:00
test-awful-tag.lua tests: Test clearing a tag. 2020-09-14 01:17:31 -07:00
test-awful-widget-button.lua tests: Test `widget:add_button()` 2019-10-06 03:50:56 -04:00
test-awful-widget-calendar_popup.lua tests: Test the calendar widget 2017-06-12 02:58:06 -04:00
test-awful-widget-only_on_screen.lua tests: Change only_on_screen to create fake screens "in sight". 2019-09-29 18:20:15 -04:00
test-awful-widget-watch.lua Make tests more reliable on "early errors" 2016-03-06 10:20:45 +01:00
test-benchmark.lua Add and use gears.timer.run_delayed_calls_now() 2019-02-15 17:04:19 +01:00
test-client-shape.lua Add a client shape test (#2214) 2018-03-12 22:53:00 -04:00
test-client-swap.lua tests: fix indenting/style (#1303) 2016-12-27 21:39:08 +01:00
test-current-desktop.lua client: Update existing code to use `c.active`. 2020-01-11 14:43:56 -08:00
test-dbus-error.lua tests: fix indenting/style (#1303) 2016-12-27 21:39:08 +01:00
test-dpi.lua capi: Move from `.data` to `._private` for the property data. 2019-11-09 16:43:12 -05:00
test-drawable-bgimage.lua tests: fix indenting/style (#1303) 2016-12-27 21:39:08 +01:00
test-focus.lua tests: Test client.active. 2020-01-11 15:43:15 -08:00
test-geometry.lua Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
test-gravity.c test-gravity.c: Accept different roundings 2018-08-17 11:48:49 +02:00
test-gravity.lua tests: do not export build_dir (#2875) 2019-09-13 17:55:06 +02:00
test-input-binding.lua tests: Test adding and removing key/mouse bindings on existing clients. 2019-12-05 22:50:02 -05:00
test-keyboard-layout-changes.lua tests: Test the awesome.modifiers 2019-01-21 01:08:48 -05:00
test-keycodes.lua Add a test for awesome.get_key_name() 2020-03-14 19:33:04 -04:00
test-keygrabber.lua keygrabber: Remove the hardcoded way to add keybindings. 2019-11-09 16:43:53 -05:00
test-leak-client.lua client: Rename the `manage` and `unmanage` signals. 2020-01-11 14:43:56 -08:00
test-leaks.lua Merge pull request #2991 from psychon/cleanup_tag_history 2020-02-13 00:31:04 +00:00
test-maximize.lua awful: Rename awful.ewmh to awful.permissions. 2020-01-11 15:43:30 -08:00
test-menubar.lua Add test for menubar.match_empty 2020-04-26 19:48:47 +02:00
test-miss-handlers.lua tests: Test root.buttons 2019-10-05 18:06:51 -04:00
test-naughty-legacy.lua notifications: Make `:reset_timer()` more intuitive. (#3175) 2020-09-27 23:34:14 -07:00
test-naughty-screen.lua tests: Disable the default `rc.lua` rules for the sake of testing. 2020-02-17 04:41:28 -05:00
test-resize.lua tests: Test more of awful.mouse 2019-12-06 01:41:42 -05:00
test-screen-changes.lua notification: Rename text to message 2019-02-16 15:26:38 -05:00
test-selection-getter.lua Rename Lua executable envvar 2021-03-23 09:10:07 +01:00
test-selection-transfer.lua Rename Lua executable envvar 2021-03-23 09:10:07 +01:00
test-selection-watcher.lua Rename Lua executable envvar 2021-03-23 09:10:07 +01:00
test-signal.lua tests: fix indenting/style (#1303) 2016-12-27 21:39:08 +01:00
test-spawn-snid.lua client: Rename the `manage` and `unmanage` signals. 2020-01-11 14:43:56 -08:00
test-spawn.lua Rename Lua executable envvar 2021-03-23 09:10:07 +01:00
test-struts.lua tests: Validate wibar geometry in the struts test 2017-02-13 22:41:25 -05:00
test-tag-gap-single-client.lua Fix awful.tag.object.get_gap_single_client (#1190) 2016-10-26 01:43:45 +02:00
test-titlebar.lua Rename Lua executable envvar 2021-03-23 09:10:07 +01:00
test-tooltip.lua Stabilize awful.tooltip code coverage (#1773) 2017-05-07 18:00:22 +02:00
test-urgent.lua Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
test-use-after-gc.lua Improve behaviour of GC'd objects 2016-09-24 14:37:07 +02:00
test-wallpaper.lua tests: fix indenting/style (#1303) 2016-12-27 21:39:08 +01:00
test-wibox-shape.lua tests: Test the input_passthrough property 2017-11-27 00:22:11 -05:00