Commit Graph

86 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 9e755d59ea shims: Minor fixes
* Allow tags to be passed to the client (fake) constructor
 * Add the border color fallback
2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 522d628c2c doc: Complete the widget documentation page.
This adds the `awful.widget` content along with some images.
2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee ac0aeb65c0 doc: Modernize the landing page.
The previous index.html was scary and the most useful links were
at the bottom. This commit fixes that.

It also adds an image of the default config with some labels to name
all visible components.
2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee e5a84e2fda shims: Prevent signals when setting the client geo to the same value. 2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee be05862bf4 doc: Add an awful.tag.clear example. 2020-09-14 01:17:31 -07:00
Emmanuel Lepage Vallee ee80fe052f init: Add an API level concept to `capi`.
The API level concept is something used by other projects such as
Android and iOS to allow deprecated features to be removed and the
bahavior to be altered without breaking compability with existing
code.

The same will apply to AwesomeWM. The current API level is "4" and
as long as config use this, no deprecation or bahavior change will
be exposed. If the user sets it to an higher value or we release
the next major version and new users start to use the, then current,
default config, they will use the new API level.

The the far future, if ever, we could fork the entire Lua libraries
to support legacy APIs. This would only require to keep the core
API support for those legacy calls. In the meantime, `gears.debug`
will use this to manage the deprecation and some conditional code
will be added as a last resort attempt to preserve behavior
compatibility while moving forward with breaking changes.
2020-02-08 17:18:01 -05:00
Emmanuel Lepage Vallee 04c757322c client: Turn `rc.lua` logic into a new `request::border` signal.
The default `rc.lua` was using the focus/unfocus signals to set
the border color along with `awful.rules`. This logic block was
no longer aligned with the rest of `rc.lua` since it was
the only place where `beautiful` variables where only used by
`rc.lua`.

On top of this, the new request handler also has extra contexts
for the urgent and floating/maximixed use cases. So it can be used
by themes to implement much smarter borders than just focus based
ones. They were previously limited by the fact most of the
(un-monkey-patchable) logic was in `rc.lua`.

Note that this commit also shuffle the awful.rules order between
the titlebar and the border and changes the tests accordignly.
After some consideration, I came to the conclusion the previous
behavior was bogus and the fact that the placement tests required
to know about the titlebar height is simply a proof of that. The
change was required in this commit because since the border is no
longer in the default rules, a new buggy edge case surfaced.
2020-01-11 15:43:11 -08:00
Emmanuel Lepage Vallee 067bcaca60 client: Rename the `manage` and `unmanage` signals.
They currently fit the general concept of a `request::` in the sense
that they are not property related and have "request handlers".

The commit also add deprecation for signals.

The reason for this fits within the larger standardization project.
Non-namespaced signals will eventually be renamed. This has started
a long time ago.

What is old is new again. Once upon a time, there was a `startup`
parameter to the `manage` signal. It is now back in the form of
a context.

Finally, this commit removes the `manage` section of `rc.lua`. It no
longer did anything worthy of being in the config. Each of its
important parts have been moved out over the years and the last
remaining bit is always required anyway. The code has been moved
to `client.lua`.
2020-01-11 14:43:56 -08:00
Emmanuel Lepage Vallee afbb3b7faf shims: Add the legacy _keys and _buttons to the client shims. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee f4cfb99cde shims: Update the `button` and `key` shims to be objects.
Now that something actually tries to set the index handlers, it
cannot be a dumb function anymore.
2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 45823f230a capi: Move from `.data` to `._private` for the property data.
This will bring the CAPI classes closer to the gears.object ones.

Fixes #2897
2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee cbb90d8bd1 root: Turn `root.keys()` into a property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 296ad18922 client: Move the `c:keys()` method to a property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 29e804a4f8 drawin: Turn `:buttons()` into a property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee d5dd3fc794 tests: Test root.buttons
Try both legacy and standardized code paths. Also try invalid mixes of
them in case some modules abuse of rc.lua and ingest the wrong format
by accident.
2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 141aca2432 root.buttons: Move to Lua.
This is the groundwork commit to support using `awful.button` objects in
`root.buttons`.
2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee b1c81c4258 awful: Set a miss handler for capi.root
There is no better place to put it and need to always be required
for backward compatibility. Given Awesome no longer works properly
without `awful`, I put the code there.
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallee 95500ea71c root: Add support for setting a miss handler.
This will allow to port some functions from C to Lua, such as supporting
`awful.key` directly when setting the buttons.
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallee 3aafa64ea7 tests: Import the backward compatibility API for all the tests.
This isn't very nice and pulls all sort of almost useless code into
the shims, making them less atomic. However the next few commits
will start another round of API standardization and the compatibility
layer wont be optional anymore.
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallee 271e2822a7 build: Allow Awesome to be built with luarock LGI. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee 53fc364ede shims: Update to handle Lua-side screen managment. 2019-09-29 18:20:15 -04:00
Uli Schlachter 0bc22aea85 client shims: Remove some duplicate code
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>
2019-09-21 13:44:38 +02:00
Emmanuel Lepage Vallee 6cb54db6c1 tests: Fix tag:clients() in the shims 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 84a0ca56a2 tests: Implement dynamic properties for the client shims.
This way enough signal are sent to display clients modified by the
rules.
2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 9283719bfb tests: Implement the fake_* screen methods 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee f0b6e36ac1 tests: Implement mouse.screen properly 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee e8c1463ce3 tests: Compute root.size() cxorrectly 2019-08-18 02:44:34 -04:00
Emmanuel Lepage Vallee 4eda67ce54 tests: Add the struts to the shims 2019-08-18 02:44:34 -04:00
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 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 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
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 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 b466db955f shims: Add awesome._modifiers 2019-01-21 03:13:26 -05:00
Emmanuel Lepage Vallee 89867386c5 tests: Add images to the tooltip documentation
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
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 90342b62c6 shims: Make sure the wibox boolean properties are set
Also make some changes to support tooltips.
2018-12-24 21:49:52 -05:00
Emmanuel Lepage Vallee 0765772c17 shims: Fix a typo in a root.fake_input name 2018-08-06 18:34:40 -04:00