Commit Graph

572 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee b4ece0f053 doc: Use an explicit tag for all static functions.
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.
2019-06-08 18:14:13 -04:00
Michael Beaumont 9e2a544ba3 naughty: Add position "middle" to center notifications in screen (#2775)
Signed-off-by: Michael Beaumont <mjboamail@gmail.com>
2019-06-08 16:10:14 -04:00
worron 5fef354892 Fix instance existing check for application spawn (#2774)
User defined matcher now has higher priority while checking
existing instance for application spawn.
2019-06-08 16:09:37 -04:00
Hùng 755c44ca52 Slider new feature `bar_active_color` and examples
- 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
2019-04-23 23:13:32 -04:00
zsugabubus 7c54e1cbf2 tests/examples: Fix minor typo in vimode.lua (#2755) 2019-04-23 23:12:20 -04:00
Emmanuel Lepage Vallée df0cdbed61
Merge pull request #2600 from Elv13/extract_rules
Extract the awful.rules logic into a gears module
2019-04-15 13:28:48 -04:00
Emmanuel Lepage Vallée 63e7c68b6c
Fix the broken test due to the "soft" merge conflict of two notification pull requests. (#2751)
* 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.
2019-04-15 13:07:53 -04:00
Uli Schlachter 8218c30a84 Improve the error message for the current breakage (#2749)
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>
2019-04-14 13:44:05 -04:00
Emmanuel Lepage Vallée dc1f87ef84
Merge pull request #2738 from Elv13/doc_tests_and_notif_p5_1
Split the reviewed groundwork commits from the notification widgets pull request
2019-04-13 12:57:58 -04:00
Alphonse Mariya 1a0c0fb2e2
keygrabber: Add test for multiple instance creation (#2712) 2019-04-08 11:21:43 +02:00
Emmanuel Lepage Vallee a081413339 tasklist: Auto-call set_client on all template widgets
This commit also update one of the example to remove its now
redundant boilerplate code.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee d5a06b0c68 tests: Share the "default look&feel" boilerplate code among the tests.
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.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee fe10119933 tests: Test the notifications. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 441c4ae98c tests: Add a notification template. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee eb1c45b656 background: Update all users so they don't use the deprecated name.
This is done before deprecating the API so no commit ever use the
deprecated name.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 59e2ae6800 shims: Set capi.screen.primary.
This is used as a fallback when some objects go out of screen.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 0c53d76f25 shims: Emit property::geometry when resizing screens.
It allows to wibars to be resized.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 6aabb73fa3 shims: Implement signal forwarding.
This make the rules, among other things, work.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee be72b4033a shims: Prevent a potential stack overflow in the client shims. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 8111495c88 shims: Set the client metatable earlier.
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.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 936040a283 shims: Add disconnect_signal.
It is necessary when adding many wibars.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 7997549067 shims: Do not select all tags by default.
It will now behave closer to the default config.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 68f6a567d1 tests: Prevent a rare-ish race condition in the buttons test suite.
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.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee dc867ef36d tests: Add an example for gears.matcher 2019-04-05 20:40:53 -04:00
mergify[bot] 795c792d11
Merge pull request #2661 from psychon/selection_global
Change the selection global
2019-03-07 02:59:33 +00:00
Emmanuel Lepage Vallée f7c20b38f1
Merge pull request #2715 from Elv13/notif_replace_id2
Fix 4 issues related to the notification refactoring
2019-03-03 16:43:09 -05:00
Emmanuel Lepage Vallee 0b820b077d tests: Fix the tests then notify-send is not installed.
Fix #2684
2019-03-03 16:24:17 -05:00
Emmanuel Lepage Vallee 4930978424 naighty: Fix to use the same object using `naugthy.notify{replace_id}`
Fix #2678
2019-03-03 16:24:17 -05:00
mergify[bot] 3ff795b4fc
Merge pull request #2716 from psychon/once_optional_rules
awful.spawn: Make rules optional in once / single_instance
2019-03-03 21:20:10 +00:00
Uli Schlachter 244932749b awful.spawn: Make rules optional in once / single_instance
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>
2019-03-03 08:52:31 +01:00
Emmanuel Lepage Vallee 9954e43521 tests: Use the same string for both notification lines.
Otherwise you cannot compare the width since `r` is thinner than `z`
in some non-monospace fonts.
2019-03-02 12:51:03 -05:00
Uli Schlachter a7f4777272 test-gravity.lua: Turn into a direct test
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>
2019-02-28 13:27:23 +01:00
Uli Schlachter f304c608e8 tests/_runner.lua: Allow non-step based tests
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>
2019-02-28 13:27:23 +01:00
Uli Schlachter ae58192951 Move selection API under the "selection" global
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>
2019-02-26 22:16:49 +01:00
mergify[bot] 2d2dba0d80
Merge pull request #2643 from psychon/selection_ownership
Add API for setting clipboard contents
2019-02-26 19:57:05 +00:00
Emmanuel Lepage Vallée f049046332
Merge pull request #2696 from alfunx/naughty-legacy-resize-on-update
naughty: Resize notification when setting text
2019-02-24 15:12:35 -05:00
Alphonse Mariya 04c9477f73
test: Test notification resizing on text change 2019-02-24 19:46:25 +01:00
Emmanuel Lepage Vallee e9d44e820d test: Test the notification ids 2019-02-24 12:08:50 -05:00
Emmanuel Lepage Vallee ecec00f425 tests: Disable a test that's invalid 2019-02-22 11:47:46 -05:00
Daniel Hahler 909ef8f532
Merge pull request #2667 from psychon/test_runner_timeout
tests/_runner: Don't lower timeouts for later steps
2019-02-19 20:44:55 +01:00
mergify[bot] 5908d9e108
Merge pull request #2683 from psychon/naughty_test_gio_dbus2
test-naughty-legacy: Use GDBus instead of spawning dbus-send
2019-02-19 18:47:07 +00:00
Uli Schlachter 828ce1471e test-naughty-legacy: Use GDBus instead of spawning dbus-send
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>
2019-02-19 18:35:09 +01:00
Daniel Hahler ddf422dd0d
cmake: fix generate-examples/check-examples (#2545) 2019-02-19 00:15:19 +01:00
Uli Schlachter d1f15f9839 tests/_runner: Don't lower timeouts for later steps
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>
2019-02-18 08:51:10 +01:00
Uli Schlachter 0ce668857e test-selection-transfer: Explain need for wait_a_bit
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-18 07:16:16 +01:00
mergify[bot] e7a67d300e
Merge pull request #2664 from psychon/naughty_test_print_warning
Some changes to the new naughty test
2019-02-18 01:33:14 +00:00
mergify[bot] fd38e2fb5c
Merge pull request #2658 from psychon/delayed_call_run_now
Add and use gears.timer.run_delayed_calls_now()
2019-02-17 19:25:04 +00:00
Uli Schlachter a54eb67de0 naughty test: Use array-style spawn() calls
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>
2019-02-17 10:30:31 +01:00
Uli Schlachter 083462e0c1 naughty test: Warn about missing dependencies
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-17 10:21:18 +01:00
Uli Schlachter 01bd2d1896 selection_acquire: Change the API to a table
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>
2019-02-17 08:00:57 +01:00