Commit Graph

324 Commits

Author SHA1 Message Date
elig0n d53eb1be67
Fix typo in client.c (#3950)
Complete parenthese
2024-09-07 23:42:37 +02:00
gldrk 16c560a568 Release all grabs when unmanaging windows
When a window is unmapped, awesome stops tracking it, possibly
leaving stale grabs behind.  These grabs can be activated if the
window is mapped again without awesome’s knowledge.  This results
in a locked pointer until the grab window is destroyed.

Fix by releasing passive grabs before untracking a client window.
2023-09-26 06:19:09 +03:00
Emmanuel Lepage Vallee 34f936b646 objects.client: Update the property documentation. 2022-08-29 22:49:47 -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 75ab366769 doc: Proof reading fixes.
* Rendering problems
 * Incomplete type information
 * Obsolete type information
 * Missing type information
 * Missing return value
 * Incomplete return value type
2022-08-29 22:48:54 -07:00
madprops 29c0057795
Fixed some typos (#3633) 2022-06-18 12:38:59 -07:00
Xinhao Yuan ab6f7e03ca
Relocate a client window as if it is undecorated when reparenting it back. It eliminates the position offset due to re-decorating when a client trys to restore its previous position. (#3253)
Add tests for geometry changes when managing/unmanaging clients. Also verified that it fixed issue #2308.
2022-02-02 22:59:01 +01:00
Xinhao Yuan 21b908bef9
Fix a regression that only property::x and property::width are emitted when all {x,y,width,height} properties are changed. (#3537) 2021-12-30 13:23:44 -08:00
Aire-One aa378a1d4c
fix(client_get_some_icon) loosness about fail
Review @sclu1034
2021-11-15 22:44:26 +01:00
Aire-One 219cff8726 doc(icon) note on default value 2021-11-15 19:18:02 +01:00
Aire-One ea349cee6a doc(client_get_some_icon) Improve description 2021-11-15 19:18:02 +01:00
Sergey 43ff4e07ad Marking readonly properties for client 2021-10-27 14:52:36 -04: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 028d01590a doc: Add a client.border_width example. 2021-10-15 19:50:03 -07:00
Emmanuel Lepage Vallee 80515c2225 doc: Fix rendering of `client:swap()`. 2021-10-15 14:27:30 -07:00
Lucas Schwiderski 4520f33309
doc(client): Improve signal wording
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-20 13:49:23 +02:00
Lucas Schwiderski dc0d5df4da
doc: Implement review suggetions
Co-authored-by: Aire-One <Aire-One@users.noreply.github.com>
2021-06-20 12:25:11 +02:00
Lucas Schwiderski bf4ad3310d
doc(client): Improve signal documentation
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-17 15:37:35 +02:00
Lucas Schwiderski 7838e89d7f
doc(client): Fix incorrect documentation
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-06-17 15:37:31 +02:00
Lucas Schwiderski e0dea455c1
doc(client): Document special case for border color
Apparently transparent client borders only work when the border color is
set to `#00000000` specifically.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-05-22 01:18:16 +02:00
Emmanuel Lepage Vallee 31fcce436c doc: Add a client border color example. 2021-03-22 00:56:02 -07:00
Emmanuel Lepage Vallee 8fb4e2b721 doc: Add a client "sticky" example. 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee a39f66e1c6 doc: Add an example for the client struts. 2021-03-21 23:58:05 -07:00
Uli Schlachter db330e0cfe
Make sure that c.name is never nil (#3251)
Fixes: https://github.com/awesomeWM/awesome/issues/3248
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-02-28 23:02:54 -08:00
Peter Lyons 764b84da56
Doc typo mislabeled height 2020-09-19 08:28:00 -06:00
Reiner Herrmann d256d90550 Move variable declarations from header to C file to fix build with GCC 10
GCC 10 builds with -fno-common by default, which causes linker errors when
variables are declared in header files and included in multiple places.

See also: https://gcc.gnu.org/gcc-10/porting_to.html
2020-04-17 19:25:40 +02:00
Uli Schlachter 8df463f971 doc: Improve the client documentation. 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 6ecab5f2f1 doc: Add documentation in each objects which emit request:: signals. 2020-01-11 15:43:31 -08:00
Emmanuel Lepage Vallee 257556793a doc: Document the client request::default_keybindings signal. 2020-01-11 15:43:31 -08:00
Emmanuel Lepage Vallee efc42b1be1 autofocus: Modify `awful.autofocus` to be a request::.
This also pulls in part of the permission framework to ensure
backward compatibility is kept.

`awful.autofocus` was always weird. It is a module part of `awful`,
but it was never part of `awful` `init.lua`. Rather, `rc.lua` was
the sole place it was used. It behave exactly like a request, but
predate them by years. As I cleanup the request:: API before the
permissions API gets formalized, this has to be fixed now.

It isn't deprecated in this commit because it makes too many tests
fail. Another pull request will solve that by adding the "API level"
concept to AwesomeWM so I can change the behavior without breaking
existing configs. With that, the behavior of `autofocus` will be
enabled by default with the permissions to disable it.
2020-01-11 15:43:15 -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 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 44a665d381 awful.rules: Use the `awful.client/mouse` default buttons and keys. 2019-12-05 22:49:59 -05:00
Emmanuel Lepage Vallee d6568993e2 awful.mouse: Add a "request::default_mousebindings" signal.
`rc.lua` and the module must attach to this signal to add buttons
to the default set.
2019-12-05 22:48:52 -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 9c0e16e623 doc: Add examples for the various maximization. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallée 85c8d5e205
Merge pull request #2854 from Elv13/uml_magic
Add some navigation helpers to the doc (in the form of UML tables)
2019-10-01 00:56:20 -04:00
Emmanuel Lepage Vallee 433898599d init: Add a command line option to start AwesomeWM without screens.
This commit add an optional `--screen off` command to initialize Lua
without first adding the screens. This is inconvinient for most users
since it restrict the APIs that are usable out of the box.

However, this allows AwesomeWM to work independently from the hardware.
This means that when a screen is unplugged, it is the Lua code that will
remove the screen instead of CAPI pulling the carpet from under. It also
allows to ignore some screen areas before the screen is ever created.
Combined, it makes it possible to work with screens even when they are
physically disconnected. Finally, it will allow for an awful.rules like
API to control how screens are created.

All in all, some people need this for their setup and some people might
want to do it anyway for fine grained and/or dynamaic multi-screen
setups.

This commit also adds 4 new signals to `capi` to be able to
execute code at specific points during the initialization. The commit
improves naughty error notifications to work even if problems occurs
before the screens are added.

Note that AwesomeWM will exit if no screens are created. While it would
be easy to just call `refresh_screen();` after unsetting the magic
variable, doing so would have corner cases. Better be harsher and
prevent the user from shooting themselves in the foot from not reading
the f****** manual. Code introduced in future commits will take care
of automatically calling fake_screen in the event nothing is created.

Fixes #1382
2019-09-29 18:52:00 -04:00
Emmanuel Lepage Vallee f0bf0df6f0 doc: Add an UML class diagram like table of cardinalities.
It will help users find how to get some objects from other objects.
2019-08-19 01:19:32 -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
Emmanuel Lepage Vallee 9d0c2200b2 doc: Add a section for the important classes.
The choice is very subjective, but at least they stand out.
2019-06-08 18:13:28 -04:00
Uli Schlachter aa21156ced Make sure we always flush after xcb_ungrab_server()
Between xcb_grab_server() and xcb_ungrab_server(), XCB's output buffer
might fill up. Thus, the GrabServer request might already have been sent
to the server, but the following UngrabServer request could end up in
XCB's output buffer. There, it might sit around for quite a while and
cause problems.

Since we cannot detect when XCB's output buffer fills up, we just always
flush after generating an UngrabServer request.

Very-likely-Fixes: https://github.com/awesomeWM/awesome/issues/2697
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-27 10:20:22 +01:00