Commit Graph

9709 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 44e6b2d24e shims: Always return something for c:tags() 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 48f973f2eb tests: Add awesome.xrdb_get_value to the shims 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee ef508462b8 shims: Add a better error message when mouse.screen is called too early. 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee d3a0dcffcd tests: Add client:kill() to the shims. 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee a18348542c shims: Enforce working on valid screen objects.
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.
2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee ce2dbea510 shims: Avoid a race condition when setting the mouse screen. 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee f7c0f419e9 shims: Fix indentation 2019-08-14 00:55:27 -04:00
Emmanuel Lepage Vallee 1617c894cc tests: Use rawget to avoid trigerring the tripwire.
The next commit will introduce extra checks that would otherwise
break this.
2019-08-14 00:55:27 -04:00
Emmanuel Lepage Vallée b2ebf899d7
doc: Fix a broken reference. (#2850) 2019-08-12 00:31:41 -07:00
Emmanuel Lepage Vallée 1e59fc7fd2
Merge pull request #2828 from Elv13/matcher_v2
Improve `gears.matcher` to be more flexible.
2019-08-11 22:29:35 -07:00
Emmanuel Lepage Vallée ed0918385c
Merge pull request #2825 from Elv13/yet_more_notif_fixes
Support the notification spec v1.2
2019-08-10 12:47:09 -07:00
Emmanuel Lepage Vallée 794da2abec
Merge pull request #2847 from Elv13/layoutlist_memleak
layoutlist: Use weak tables to store the cache.
2019-08-08 23:54:37 -07:00
Emmanuel Lepage Vallee f3dc57f3f4 layoutlist: Add more caching.
Technically this doesn't solve any memory leak, but AwesomeWM uses in
average less memory when changing the selected tab in quick succession.

This is because it has less "temporary" tables to track.
2019-08-07 04:27:56 -04:00
Emmanuel Lepage Vallee d832b8c9b8 layoutlist: Use weak tables to store the cache. 2019-08-07 03:21:17 -04:00
Emmanuel Lepage Vallée c4c97174e6
doc: Fix a rendering regression regarding backgrounds. (#2820)
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
2019-08-06 22:48:06 -07:00
Emmanuel Lepage Vallee 67e5dd3091 matcher: Match all sources when none is provided.
Nobody wants to set this parameter. It is necessary because the old
API allowed `awful.rules` to be used with random for random matching.

This stopped "really" working between the 3.4 and 3.5 release because
the code started to accumulate "corner case" fixes aligned with the
client properties. v4.0 added more ordering and v4.3 added external
sources. After this, it is unusable with external objects, but
`gears.matcher` handle this use case very well.
2019-08-06 02:20:01 -04:00
Emmanuel Lepage Vallee 91ca922671 tests: Test the gears.matcher greater and lesser sections. 2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 64bef57013 matcher: Add a `greater` and `lesser` matching sections.
In a perfect world we would have pure expression matching, but
that's problematic with all the "metaness" of the code. For now,
this adds an imperfect way to match the minimum and maximum of
number properties.

It will be used by the screen rules for the DPI and size properties.
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 2dc8c62b9b tests: Test gears.matcher "rule_every". 2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee b40083780e matcher: Add a "every" and "every_any" sections to the rules.
So far the "any" rules had a "OR" and "NOT" logic "gates", but not
an "AND".
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 3e4f292906 matcher: Fix the doc.
It was developed in parallel to the new doc format and wasn't updated.
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 774465df4d doc: Add the new grears.matcher features to the lone example.
This isn't really intended to be used outside of the object rules.
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 801ae69f23 matcher: Add a custom setter for "fake" object properties.
This is hardcoded in `awful.rules`, but cannot be shared due to the
priority corner cases. Given in the long run any "standard" priority
should use the topological sort API, better not try to share *that*
code.
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 9a16ee62e6 matcher: Add a way to match properties beside == and patterns.
It is useful for objects and avoid the mess that it Lua == overload.

The primary use case will be to match tags by name or object.
2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee f3f9e4a4b5 matcher: Allow rules to be addressed using an identifier. 2019-08-03 18:26:06 -04:00
Emmanuel Lepage Vallee 886f8ea4e3 matcher: Use gears.object.
This way there's some signals. It can be useful if the module using the
matcher needs to act when something happens.
2019-08-03 18:26:05 -04:00
Emmanuel Lepage Vallee d8b53dac5d matcher: Add methods to add new rules.
It is now possible to add and remove rules. This is superior to how
`awful.rules` originally handled rules because modules can now
assume adding and removing rules works.

The reason for the methods rather than `table.insert` is partially
because future commits will add signals. In turn, this will allow
`gears.matcher` to be extended by module using it using the extra
"introspection" made possible by the signals.
2019-08-03 18:26:01 -04:00
Emmanuel Lepage Vallee 6d58d7b4a2 tests: Test that the legacy naughty popup is used when the new API fails
Displaying errors is important. If the notification popup caused the
error, it was likely nothing could be displayed.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee dcd034dcac naughty: Add 2 levels of fallback when the `widget_template` fails.
* First, it will try the default widget template
 * If that fails, the `request::fallback` handler will use the legacy
   popup.

Ref #2829
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee c0ef0c8802 tests: Expose the previously private gears.protect_call error handlers.
This will allow the test suits to intercept them instead of adding more
and more exceptions to `run.sh`.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 423aeebe8a naughty: Add more default values.
Without this, some variables could accidently be set to `nil` by the
dbus code. Ignore now also has a default.

Ref #2829
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 529f4be53e tests: Check that naughty emits "request::display_error" when needed. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee aed2af44b6 tests: Check if using client icon doesn't exceed the size constraints. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 6761778830 tests: Test the notification icon theme request::icon support. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 4fe05a566d tests: Test exposing the notification persistence and animation props 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 7d609fb69b tests: Test the notification spec v1.2 "resident notification" support.
If a notification is resident, invoking an action should not destroy it.
If an action is not resident, invoking an action destroys it.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 30b42905da notification: Fix a typo in the closed_reason API name.
It wasn't part of a release and nobody uses that anyway.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 1bd2c1977e notification: Add an `append_actions` method.
The name is self explanatory, it adds more actions to a notification.

One of the use case is adding a snooze/reming_me action. Another one
is "mute similar notifications".
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee e524f93baa notification.action: Allow actions to be shared by multiple notification
The reason is that if actions are provided by rules, only one instance
exist. It was a mistake to couple actions with their notifications. It
could not work reliably and has to be removed.

The commit also change the notification action storage to be a copy
instead of the original table. This allows to append actions (not part
of this commit) without risking adding them to the wrong notification.

**WARNING** This break an unreleased API by removing the `notification`
property of an action.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee f8cbb54913 naughty: Expose 3 previously internal properties.
* app_name: To be used in filters when no clients are found.
 * max_width: Allow to set it from the rules, it might be different
    when a `widget_template` is used.
 * widget_template: Now it can be set from the rules without further
    boilerplate code.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee e77ca1f4d8 naughty.widget.legacy: Use values from the notification objects.
Previously it used the `args` table passed to the constructor.
This will not work with rules since they modify the object, not the
args.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 78c616c358 notification: Allow nil to be set to the timeout to rmeove it 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 84ae41422f notification: Prevent the timer to be started early in the constructor.
Otherwise the timer will be started before the preset is applied.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee b9d19988b9 rc.lua: Replace the error handling code with request::display_error.
It is easier to understand, shorter and more modular.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee c36d35756f naughty: Begin to deprecate the presets.
The old preset code had a primitive implementation of the rule API
used in `naughty.dbus`. Now that `gears.matcher` is extracted from
`awful.rules`, it is possible to share the code.

The first step is to only enable the old API when the new
`request::preset` isn't connected. This is the same way the legacy
popup is only enabled when nothing is connected to `request::display`.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 41149ed335 class: Share the module level signal system implementation.
Avoid adding another copy.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee c10312b511 naughty: Fix a race condition which cause startup errors to be missed.
This commit will be "reverted" when the screen refactoring is merged
since it has a better fix.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee efbc707279 naughty: Move the boilerplate rc.lua error handling to naughty.
This removes the imperative "mutex" logic from rc.lua, where it doesn't
belong. It also makes it closer to the "vision" of making `rc.lua` fully
modular.
2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 047245fd03 notification: Add a default urgency value. 2019-08-03 01:45:22 -04:00
Emmanuel Lepage Vallee 2ff4a5294c naughty.widget.icon: Use `surface.load_silently`.
Icons can be names from the icon theme. This wont load until a better
icon theme API is added (since this module doesn't depend on menubar).
2019-08-03 01:45:22 -04:00