This template allows to display a sequence of events for the clients,
tags and screens. Currently, it is hard to display images where the
state of an object is more complex than "here how it was before" and
"here how it is now". With this template, it is possible to have a
timeline of events from the initial states to the final states.
Now, as the line count shows, this isn't small. It is in fact an
enormous template. Worst still, this commit is the first *half* of
it. The second half adds the ability to `print()`, display
inline code and support mouse and keyboard events. The code also isn't
world class. Maintaining this template might be non-trivial in the
long run. I am fully aware of those issues. On the other hand, there
is ~100 places where this will be used once the entire
"new rule library" project is completed. This will bring the ~1.2k
line of code to ~12 lines per consumer. From that point of view,
it makes a lot more sense to merge this given how useful it is
at explaining changes within the "core objects".
It is also important to keep in mind that there is currently very
little or no documentation (beside the mandatory one-liner summary)
for these concepts. Those are the most important aspects of AwesomeWM
API and they are the least documented. This is just wrong.
Previously, it would create screens outside of a visible output area. In
the following commit, this will be tracked and a warning is printed when
it happens. This makes the test fail.
Both commit 44e6b2d24e and 4eda67ce54 added the same function to this
file (and by the commit message, the later was intended to do so, while
the former has an unrelated commit message (but does not contain any
other changes)).
Signed-off-by: Uli Schlachter <psychon@znc.in>
* test-selection-transfer: clarify comment / condense
Noticed this via flaky coverage for the check after the "wait_a_bit"
block.
Ref: https://codecov.io/gh/awesomeWM/awesome/pull/2872/changes#L193
* tests/_runner.lua: add support for wait_per_step
Might be good to have a short version of it (single line), but extra
lines are indented, so this seems to be OK.
This helps / shows when the built version is not up-to-date (e.g. after
git-bisect), and serves as a basic check that it can be run in the first
place.
In case of error, well, make an error, but update the content anyway.
This will be enough for the CI but makes development less painful.
Also update the cmake targets to re-generate them more often.
Previously it was possible to manipulate deleted screens and that
made debugging harder down the line. By catching this early, it
wont be as nightmarish.
The way background are rendered changed to accomodate issues regarding
cliping and border. However this broke the documentation examples.
This commit fixes this in the least hacky way I found.
Fixes#2727
* action icons
* persistence
* residence
* categories
* animated icons
* more ways to get icons
In addition, the commit also tries its best to attach notifications to
objects using various dubious semi compliant hints or the DBus PID. It
works often enough to be useful.
Add a test which recreates the titlebar for an existing client and
checks that widgets from the old titlebar instance can be GC'd.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
Test the behavior of awful.placement.no_overlap when placing clients on
unselected tags. Currently this tests only the most common case with
only a single selected tag and a single tag set for each client.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
Clients which are sticky should be taken into account by
awful.placement.no_overlap even if they seem to be on a different tag;
add a test to verify this behavior.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
Clients which are hidden or minimized should be ignored by
awful.placement.no_overlap; add a test to verify this behavior.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
In order to test the behavior of awful.placement.no_overlap with
unselected tags, the test sequence must be able to run multiple times.
Fix the test code to make this possible (currently it just performs the
same sequence 3 times, the code to actually test the behavior with
different tags will be added later).
Indentation is unchanged to make the changes obvious in diff; the next
commit will contain formatting changes without anything else.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
This commit also add some "magic" comments to existing tests so they
render correctly. Note that some older commits predates these "magic"
comments, which is why they are not there.
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.
- Fill slider bar with a linear pattern based on current value (if `bar_active_color` and `bar_color` are correctly provided)
- Add examples for the apidoc
* naughty.legacy: Fix a regression caused by a prior fix.
The title was only set "later" because it was called too early.
The intended result was to prevent the code from being executed when
there is no leagcy popup, but it had this side effect.
* naughty.dbus: Expose the new "private" methods so they can be tested.
Because it now uses Gio instead of capi.dbus, it isn't possible to
just shim the backend anymore.
* shims: Upgrade the dbus shims to also emulate some Gio behavior.
As usual, it is the most basic version that produces the correct
result. It doesn't try to comply to the real API.
The tests for naughty are currently broken, because naughty.dbus now
uses Gio for interacting with DBus, but the tests still try to use
awesome's dbus object. Turn the resulting weird error into something a
lot less cryptic.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This will avoid some copy/paste in future tests.
The commit also fixes a typo and a missing --DOC_NO_DASH which breaks
rendering with one of the markdown implementation.
Once the signals get propagated, it means "manage" will call code before
the metatable is set. If this happens and it sets some properties, they
will perpetually bypass the `awful.client.object` handler.
Given there is some async wibox redraw operations, there is a tiny,
tiny chance the test suite callback will be executed before the
redraw. It has been seen on the CI, so it is not 100% impossible.
There is not much good reason why this should be required and making it
optional is almost trivial, as this patch shows.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes test-gravity.lua use the new infrastructure that was
added in the previous commit: Instead of pretending to be a steps-based
test, this is now a direct test. This gets rid of all the useless
wait_a_bit steps that exist purely to satisfy the steps-based test
runner.
This commit makes test-gravity.lua about one third shorter. Also, the
test might run a tiny bit faster, since there is no more timer that
regularly checks if the test is done, but instead it finishes
immediately when the external process finishes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The current _runner.lua expects a table containing steps to be passed
in. However, not all tests look like this. This commits adds an API to
the runner that allows tests to run however they like. They just have to
call run_direct() initially and call done() when they are finished.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This moves selection_acquire to selection.acquire, selection_getter to
selection.getter and selection_watcher to selection.watcher. The only
user-visible change due to this is that type(selection) is now "table"
instead of "function". If that breaks something for you, tough luck.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This is inspired to be a correctness fix: The "hints" argument to
notifications is supposed to have type a{sv}, i.e. this maps from string
keys to some generic value. dbus-send does not support this and instead
it sends an argument of type a{ss}, i.e. a mapping from string to
string. This commit fixes this problem and uses the correct type.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The first step of a test is called 20 times before a failure is
diagnosed. Later steps only get five calls to finish. I guess the idea
is that the first step sets everything up and opens all necessary
clients, while later steps then do something with these clients.
However, looking at our existing tests, they are not structured like
that. Later steps open more clients etc.
Since this limit has no negative impact on the run-time of tests, but
only means that failures are detected later, let's just remove this
limit of five calls.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When a string is spawned, the C code has to split this into an array for
the execve() syscall. When an array is given directly, this array does
not need to be transformed in any way. This makes it much more clear
what is actually started.
This commit removes some quotation marks that were previously removed by
the C code. For example,
array:string:1,"four",2,"five",3,"six"
became
array:string:1,four,2,five,3,six
because otherwise the action was called "four" instead of four and the
test failed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
As requested in the review, instead of just having a single string
argument, selection_acquire() now has a table as its argument. It
searches the string under the "selection" key here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This new test suit add a rather extensive coverage to the "legacy"
notification popups. A few minor bugs have been found and fixed
and we can rest assured that the new spec 1.2 support and extended
manipulation API wont regress existing configs.
This adds require("_date") to some example tests that use the current
date via os.date. This allows reproducibility by replacing os.date()
with a function that uses a static date from $SOURCE_DATE_EPOCH. See
commit 9d7eaf0 for more details.
Signed-off-by: Uli Schlachter <psychon@znc.in>
It also add some properties such as `border_width`, `border_color`
and `preferred_alignments`.
It also fix a documentation bug where the `margin_topleft` was called
`margins_topleft`. To conform to the documentation, both are now valid
but one should be removed the next time the API changes.
Fixes#1978
To happen, both of these races have to be lost by client3
* client2 have to take more time to `:kill()` than client3 take
to be spawned.
* client4 have to start faster than client3
It is very unlikely to happen on normal systems, but on server it
happens. Some factor that may or may not be involved
* The scheduler assigned client2 on a very busy CPU and client 3
on a CPU still busy while some other CPUs are idle
* Linux is bad at scheduling hyper-threading
* The system is NUMA and the memory bandwidth is lacking on a core
* There is some "Z" memory compression or drive based swap
* Extreme bad luck
Fix#2424
In the earlier revision of the keygrabber PR, there was a `release_key`
and it was suggested to rename it `stop_key`. However its sibling
`release_event` wasn't, so it is now confusing.
The commit adds a mild deprecation codepath to avoid breaking configs
based on git-master. However it isn't a "long term" deprecation notice
and the code can probably be removed in 5.0 without further delay.
Test that the placement function used in the default configuration
behaves as intended. This test was failing before the no_overlap and
no_offscreen fixes in two previous commits.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
The awful.placement.no_offscreen function did not work properly when
composed with other placement functions; in particular, the default
configuration (awful.placement.no_overlap+awful.placement.no_offscreen)
was broken. The compose function sets args.pretend=true and puts the
result of the previous placement function into args.override_geometry
before calling the next placement function, but no_offscreen did not use
args.override_geometry, therefore the result of the previous placement
function was discarded.
All other placement functions use `geometry_common(c, args)` to get the
current client geometry; `area_common(c)` should be used only when
getting geometry of other clients.
This change also fixes the problem with margin handling (adding margins
should not affect the window size, only the window position should
change); the test output which was adjusted in commit 0275d3537d
is adjusted again to account for this change.
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>