Commit Graph

9586 Commits

Author SHA1 Message Date
mergify[bot] 7b7dcdd87a
Merge pull request #2740 from Elv13/more_notif_fixes
Fix 2 more notification issues
2019-04-07 08:34:22 +00:00
Emmanuel Lepage Vallee dce1830b89 naughty: Fix a rebase mistake when using actions.
Some older revisions called it `trigger` instead of `invoke`.
Apparently some rebase conflicts introduced the old name in
merged code.

See #2729
2019-04-05 22:20:16 -04:00
Emmanuel Lepage Vallee 1a5685ee45 naughty: Require `naughty.action` by default.
Fixes #2730
2019-04-05 22:16:44 -04:00
Emmanuel Lepage Vallee 28541c8e82 doc: Update the NEWS for the new features added by this pull request. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 5c57f43643 tasklist: Use awful.widget.clienticon by default.
This allows sharper icons to be used.

Fixes #2143
2019-04-05 21:06:11 -04: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 aa6ab69ffc taglist: Auto-call set_tag on each widgets of the template.
This reduced the boilerplate code.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee e452ec8e27 awful.widget: Use private `args` for the update_function.
Previously, it would use the "real" args passed to the constructor.

It was a bad decision since:

 * It doesn't allow the tag/tasklist to add properties internally
 * It forces the widget to be created with a constructor rather than
   the alternate declarative syntax
 * It doesn't allow a tag/tasklist to be part of a widget_template

Technically this is a behavior change, but I doubt anybody will notice
given it is a dark and little documented corner of the API. Chances are
nobody have been using this API for years.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee d5a2fe0072 awful.widget: Add an helper to set a property on all template widgets
With this helper, it becomes possible to avoid manually setting common
properties such as the client in the tasklist of tag in the taglist when
the children widgets of the template have a set_+property_name.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee e79a5c5988 awful.widget: Add a `create_callback` to the common list.
This is like its template equivalent, but "private" to the list
widget.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee db2d4b92df awful.widget: Add support for icon_size.
This decision was taken out of necessity. While adding more style
elements to `awful.widget.common` isn't something I want, there is
little else to do here. The problem is that popup based lists only
have size constraints in one direction. So without a way to limit
the icon size, it will take 9999 pixels.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 94e5517938 tests: Improve the awful example template
* Support async operations
 * Support `awful.popup`
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 97417121ad naughty: Add a property to get all active notifications. 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 d99f8461ef naughty.legacy: Do not update the text if the notification has no widget
If the notification has been created without a legacy widget, it would
try to update some widgets that have never been created.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 7adbbd3f7c awful.common: When a border is set, shrink the widget by its size. 2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 8ac1f67237 container.margins: Allow the `margins` property to be a table.
It makes some code easier to write. It is mostly useful when the margins
are exposed through another widget. In that case it avoids having to
proxy 5 different property or re-invent the wheel there.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee c1596f0b4e background: Deprecate `shape_border_(width|color)`.
In favor of `border_width` and `border_color`.
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 81ff4d730c background: Always allow a border.
Previously, the border "support" was limited to shapes and would not
move the content by the offset of the border. Borders are now better
supported and thus renamed from `shape_border_width` to `border_width.

In the end, shrinking the widget by the border size is too common to
ignore. It should have been the default all along, just like the clip.
2019-04-05 21:06:11 -04:00
Emmanuel Lepage Vallee 02ed7ceed5 widget.base: Allow widgets constructor in the declarative template.
This avoids the boilerplate of having to do:

    {
        widget = awful.widget.mywidget
    }

in the templates.
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 50d4e8f04b doc: Add a deprecated property section. 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 80cb6f299e doc: Fix an awful.autofocus warning 2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee 0b4bb05b45 rules: Add a new documentation section for how to write a rule 2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee 91bea445d2 awful.rules: Use gears.matcher
Extract the code so it can be reused without pulling too many internal
APIs with it.
2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee dc867ef36d tests: Add an example for gears.matcher 2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee 74c2e7382e gears: Extract the logic code from awful.rules into gears.matcher.
The use case for this is to reuse the matching logic for other objects
such as tags or notification.
2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee 58bafe8ef4 doc: Add a common documentation for for the rule components. 2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee fa801ac441 ldoc: Do not proces the drag_to_tag file
It has no public doc. This avoids a warning.
2019-04-05 20:40:53 -04:00
Emmanuel Lepage Vallee 9befa1ec32 ldoc: Add a new "rulecomponent" section.
It is going to be used by `awful.rules`, `gears.matcher`,
`naughty.rules` and `selection.rules`.
2019-04-05 20:40:53 -04:00
mergify[bot] c02ad71b0c
Merge pull request #2735 from psychon/common_default_template
awful.widget.common: Use a template for the default template
2019-04-01 23:51:52 +00:00
Uli Schlachter f84e72d0d5 awful.widget.common: Use a template for the default template
Instead of having the default template hardcoded as code, this turns the
template into a descriptive version. This makes it easier to come up
with own templates: Just copy the default template and make a slight
change to it.

No functional changes are intended, but I cannot rule out that I did no
mistakes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-28 18:51:13 +01:00
Uli Schlachter c2f29b04ee naughty.dbus: Fix inline icon data handling
LGI truncates GVariant bytestring instances at the first embedded \0
byte when using .value for "unwrapping". This commit works around that
problem by avoiding the .value API for accessing the image data [0].

Thanks a lot to Will Dietz for finding this problem and for providing a
preliminary patch fixing the problem. That saved me a lot of time [1].

[0]: https://github.com/pavouk/lgi/pull/223
[1]: eecdeb7d46

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-22 18:08:24 +01:00
Will Dietz 9af1ed9a0f dbus.lua: don't include types, it's magical enough to not need them
(and so we were including "s" capabilities)
2019-03-18 21:16:54 +01:00
Uli Schlachter 047ef30d59 naughty.dbus: Switch to using Gio for DBus bindings
This starts the switch from our own, semi-broken DBus bindings to using
the sane bindings that Gio provides.

Part-of: https://github.com/awesomeWM/awesome/issues/1093
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-18 21:16:54 +01:00
Will Dietz ed0c3ceb2c don't replace 'destroy' in existing notification, set destroy_cb (#2728)
The value passed as `args.destroy` becomes `destroy_cb`,
so use that name when updating an existing notification.

Fixes #2721.
Might also resolve #2692.
2019-03-18 14:03:14 -04:00
mergify[bot] d8687dc251
Merge pull request #2724 from necauqua/patch-2
Add forgotten nil-check to `notification.reset_timeout`
2019-03-13 22:01:02 +00:00
Adrian Gabriel 0642d92967 Fixed input_passthrough property not being set (#2723)
* Fixed input_passthrough property not being set

In the table of properties supplied to the `wibox` function, you couldn't set the `input_passthrough` property. You could only set it after the wibox was created like this: `my_shlick_wibox.input_passthrough = true`. This commit fixes that and now you can set it in both ways.
2019-03-12 17:23:53 +01:00
Anton Bulakh 8493fd1829
Add forgotten nil-check to `notification.reset_timeout`
When you call `reset_timeout` on a notification with 0 timeout and thus no timer, a nil field error occures.
(can be tested with `awesome-client 'require"naughty".notification{message="TEST",timeout=0}:reset_timeout()'`)
Everywhere else in similar places (even at the beginning of the `reset_timeout`) the `self.timer` field is checked so i guess it was just forgotten there.
2019-03-11 20:45:31 +02:00
mergify[bot] f69b72ab36
Merge pull request #2706 from psychon/update_new
Mention the new selection API in NEWS
2019-03-09 18:07:37 +00:00