Commit Graph

130 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 418bf92858 awful.client: Update the property documentation. 2022-08-29 22:49:46 -07:00
Emmanuel Lepage Vallee 86d1b1c22c doc: Add a mandatory `@noreturn` for functions and methods.
The goal is to catch cases where the return value exists, but is
forgotten. There was a large enough number of them to turn this
into a real check. Initially, I just wanted to implement it to fix
the problems, then delete the code. But since this is so common, I
think it is worth the annoyance.
2022-08-29 22:49:45 -07:00
Emmanuel Lepage Vallee 4bd90f0f35 doc: Add documentation linting and fix all issues it found. 2022-08-29 22:48:54 -07:00
Emmanuel Lepage Vallee f3987f43b6 doc: More proof reading fixes. 2022-08-29 22:48:54 -07:00
Emmanuel Lepage Vallée d5fae3f3dc
Merge pull request #3478 from Elv13/better_shims
Fix a few sequences template bugs
2021-10-28 12:27:11 -07:00
Emmanuel Lepage Vallée c8ada80fb3
Merge pull request #3484 from Elv13/2012_misc_fixes
Miscellaneous small bug fixes
2021-10-28 12:26:47 -07:00
Emmanuel Lepage Vallee 5069f5c2ed client.floating: Add a missing signal connection.
The `fullscreen` state does affect the outcome of the state, so
it needs to be connected for request::border to be sent.
2021-10-27 20:08:15 -07:00
Emmanuel Lepage Vallee 7d6892992c client: Change the `relative_move` behavior.
The old behavior would move the client when `nil` was passed by
an almost arbitrary value. It would most of the time go off screen.

While this is a behavior change, what it replaces was so broken I
doubt anybody actually used `nil` in `relative_move`.
2021-10-27 18:30:30 -07:00
Sergey 212ec72236 Removing read only from properties descriptions. It's set with ldoc tag now. 2021-10-27 14:52:36 -04:00
Sergey 43ff4e07ad Marking readonly properties for client 2021-10-27 14:52:36 -04:00
Emmanuel Lepage Vallee b2603f6a86 doc: Add images for awful.client.* functions. 2021-10-18 14:38:37 -07:00
Emmanuel Lepage Vallee cbec148540 doc: Make sure all client.focus functions are in the same section.
Some were in the @staticfct and some in the @function sections.
2021-10-18 14:38:37 -07:00
Emmanuel Lepage Vallee ae71158093 doc: Add documentation for the client "window factor" related functions
It might be a good idea to deprecate them and move them to the tag
class. However, these APIs are not exactly well designed, so
moving them wont solve that. Some day the dynamic client layout will
hopefully be merged and send these functions to the heap of smelly
bad ideas trash.
2021-10-18 14:38:37 -07:00
Emmanuel Lepage Vallee a8d2fa0297 doc: Add a large number of `client` examples.
Backfill some under-documented APIs with yet more shiny images.
2021-10-18 14:38:37 -07:00
Emmanuel Lepage Vallee 785ca98337 client: Turn client.setslave/setmaster into properties.
It also no longer use the master/slave name. In this case, it kinds
of make sense since, for example, of the tag `master_count` is greater
than the number of clients, calling `client.setslave` move the client
to another "master" slot.

Closes #626
2021-10-15 20:00:23 -07:00
Elyes HAOUAS 54a5a7dce5
Fix some spelling errors (#3450)
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-04 19:20:03 -07:00
Lucas Schwiderski 1b49a20e0d
doc(awful.client): Document special signal semantics
While the documentation already specified the signal via `@emits`, it
did not make it clear that this signal is emitted on a `tag` object,
rather than the `client`.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-05-22 01:24:07 +02:00
Lucas Schwiderski 4f1b308e2b
doc(awful.client): Improve documentation for c:to_selected_tags
The behaviour of `c:to_selected_tags()` does not match what one would
have expected from its short description.
The behaviour also doesn't really match the method's name, but since
this is already in use, I won't change functionality or names here.

Instead this extends the method's documentation to accurately reflect
its implementation and also point users to the functionality that they
were likely looking for based on the method's name.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-05-22 01:08:55 +02:00
jpkotta aba1cf398f
fix client:activate action mouse_center (#3257) 2021-02-28 23:03:14 -08:00
Unai 1518b0f4c0
Border_marked naming consistency (#3084)
* finish renaming border_marked to border_color_marked

* doc: document border_color_fullscreen, update border_color_marked and fix typo

* deprecate instead of removing

* doc: fix border_color_marked
2020-05-04 01:42:09 -07:00
Emmanuel Lepage Vallee 92d6fcda92 client: Check if `border_widht` is `nil` before setting it.
Fix #3026
2020-03-07 21:34:02 -05:00
Unai Fernández 2c51493a69 client: Fix property.persist 2020-02-28 13:25:02 +01:00
Uli Schlachter 8df463f971 doc: Improve the client documentation. 2020-01-19 20:30:06 -05:00
Emmanuel Lepage-Vallee cb9c33cda8 "Really" deprecate the client marked and unmarked signals.
The doc said they were deprecated in 4.0, but back then there was
no API to deprecate signals.
2020-01-19 20:30:06 -05:00
Emmanuel Lepage-Vallee 74ba84b299 doc: Make use of the @classsignal tag.
It wasn't doing anything until now.
2020-01-19 20:30:06 -05:00
Emmanuel Lepage-Vallee 575b0f12dc doc: Remove all type aliases.
They render poorly and serve no purpose.

    #!/bin/bash
    for FILE in $(git ls-files | grep -E "\.(h|c|lua)" | grep -v tests | grep -v spec); do
        sed -i 's/^[ ]*--*[ ]*@client /-- @tparam client /g' $FILE
    done
2020-01-19 20:30:06 -05:00
Emmanuel Lepage-Vallee 5e720c9744 doc: Major client documentation backfill.
This commit mostly rewrite the client documentation and pay the
technical debt accumulated over the years. Most of the client
documentation was still one-liners from the luadoc era. It now
has all the new tags, type. It also has actual description of
what the properties do beyond the name.
2020-01-19 20:11:19 -05:00
Emmanuel Lepage Vallee 20743a9a16 Remove all usage of the now deprecated `awful.rules`. 2020-01-19 02:59:10 -05:00
Emmanuel Lepage Vallee e309059f4c doc: Add more example to awful.client. 2020-01-19 02:58:49 -05:00
Emmanuel Lepage Vallee 6ecab5f2f1 doc: Add documentation in each objects which emit request:: signals. 2020-01-11 15:43:31 -08:00
Emmanuel Lepage Vallee 668ed6135c client: Add a `:grant()` and `:deny()` method for permissions.
This is a lower level API than what most people will end up using
(the rules), but it is useful enough to expose to the public API.
2020-01-11 15:43:31 -08:00
Emmanuel Lepage Vallee 5818de41ce awful: Rename awful.ewmh to awful.permissions.
It has nothing to do with EWMH since a long time. It was already used
for the requests, so lets formalize this.
2020-01-11 15:43:30 -08: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 c10bdc3cfe client: Add a property::active signal. 2020-01-11 14:43:56 -08:00
Emmanuel Lepage Vallee ba5385dd40 client: Update existing code to use `c.active`. 2020-01-11 14:43:56 -08:00
Emmanuel Lepage Vallee 58f3ea740f client: Add an `active` property to check if a client has focus.
This follows in the footsteps of:

 * request::activate
 * awful.ewmh.add_activate_filter
 * c:activate{}
2020-01-11 14:43:56 -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 cd253ed815 client: Add an `activate` method.
This method aims to provide a centralized, declarative API to focus
clients. Currently, there is tons of code using "request::activate",
including `rc.lua` and have extra boilerplate code around it to
handle some corner case (such as minimization and clients already
having the focus).

This code takes room, is repetitive and force some imperative logic
to be in `rc.lua`.
2020-01-11 14:43:56 -08:00
Emmanuel Lepage Vallee a065e2e1a9 client: Add append/remove methods for buttons and keys.
Another step toward ensuring all components can be manipulated
non-destructively by modules.
2019-12-04 02:05:05 -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 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 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
Emmanuel Lepage Vallee 63ca0f0d8f doc: Use an explicit @method stereotype for all methods.
ldoc has a magical `@classmod` module type which tries to detect
what is a method and what is a static function. It fails about as
often as it works. This commit makes everything explicit to remove
such issues.

Fixes #2640
Ref #1373
2019-06-08 18:13:42 -04:00
fREW Schmidt 021bf689d7 Replace doubled immobilized with correct properties for each immobilized (#2770) 2019-05-25 06:17:26 -04:00
Sergey Vlasov d266309ef8 awful.client: Fix c.requests_no_titlebar
The property was always false because of a typo.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-11-12 11:48:59 +03:00
Emmanuel Lepage Vallee 90b17bdc09 awful.rules: Add proper documentation to the extra client properties.
Until now there wasn't much documentation available about how to use
these properties. With the new work on `awful.spawn` that rely more and
more on `awful.rules` integration, it is worth fixing.

This commit add a new documentation section and a future commit will
aggregate them to generate an index.
2018-10-10 01:58:18 -04:00
mergify[bot] 2f70fd6cce
Merge pull request #2409 from Elv13/spawn_once
A better run_or_raise/spawn.once/singleton API
2018-10-07 11:35:11 +00:00
Emmanuel Lepage Vallee 021a1feec8 awful.spawn: Add a `raise_or_spawn` method. 2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 927e7b2796 awful.spawn: Add an `once` and `single_instance` methods.
This commit adds a way to leverage the xproperty and startup_id APIs
to persist an execution token across restarts. It allows to use
`awful.rules` on clients that were executed by a previous Awesome
instance.

The main limitations of these methods is the lack of entropy used to
build the token. If the command is the same in multiple
`awful.spawn.once`, then it will not work as expected. To mitigate this
issue, the system try to concatenate the `awful.rules` table after the
command and hash the resulting string. Given rules are a table, it can
have loops and/or issues with keys ordering. The hash function sort and
limite recursion to prevent a stack overflow. Another issue is the
unreliability of startup notifications.
2018-10-04 09:16:00 -04:00