Commit Graph

2228 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 973671b081 doc: Document that awful.mouse.resize/move use the permission framework. 2020-02-02 21:07:06 -05:00
Emmanuel Lepage Vallee 44301589c4 wibox: Connect the existing request::geometry signal to an handler.
The signal has been implemented for years, but nothing was connected
to it.
2020-02-02 21:07:04 -05:00
Aire-One 02b1a6b633 Fix missing `self` parameter in documentation usage examples. 2020-01-28 10:57:43 +01:00
Emmanuel Lepage Vallée 2f905f2522
Merge pull request #2895 from Elv13/ruled_client
Move `awful.rules` to `ruled.client`.
2020-01-19 20:15:52 -05: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
laith-m0 65512b5ea9 Fix prompt navigation (#2970)
1. Open any awful.prompt(mod+r or mod+x)
2. Type ()->
3. Press alt+b two times
2020-01-19 19:00:56 -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 71c230035c rules: Move `awful.rules` to `ruled.client`.
From now on, all core object will have their own rules. `awful.rules`
hardcodes some client specific code. All `rules` module have some form
of class specific code. This code will now be part of a new module
called `ruled`. Since a year or so, a lot of work has been done to
refactor the rules on top of the shared `gears.matcher` class. This way
there wont be as much duplication.
2020-01-19 02:58:37 -05:00
Emmanuel Lepage Vallee 39c90b8303 hotkeys: Port away from awful.rules 2020-01-19 02:39:30 -05:00
Emmanuel Lepage Vallée 5ad02d0b8b
Merge pull request #2948 from actionless/vim-keys-add-folds
Vim hotkeys: add folds
2020-01-18 16:56:33 -05:00
Seth Barberee ab6381686e add calendar_popup pic to doc 2020-01-17 16:02:18 -06: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 e77dd01e5a Add more TOVOv5 for unfixable APIs.
Another pull request at some point will add proper API levels,
it will then become possible to fix these without breaking
the API for everybody. However right now there is no way around
the problems.
2020-01-11 15:43:31 -08:00
Emmanuel Lepage Vallee 6b427e73a8 tag: Add a request::layouts signal and append/remove layout. 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 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 5ad0856fee layout: Add a `request::default_layouts` to fill the list of layouts.
This will allow the default client layout list to be manipulated by
modules without the risk of overwriting each other.

The commit also add a new `--{{{ Tag --}}}` section to `rc.lua`. It will
be expanded once the tag rules get merged.
2020-01-11 15:43:15 -08:00
Emmanuel Lepage Vallee 55a097efc7 client: Update existing code to use `property::active`. 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 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 833948ea67 doc: Polish the awful.widget doc.
A lot of them were missing the inheritance includes.
2019-12-21 21:53:57 -08:00
Emmanuel Lepage-Vallee c32c2bf43d doc: Upgrade the keygrabber to the newest standards. 2019-12-21 21:27:21 -08:00
Emmanuel Lepage-Vallee 3af095e4b0 doc: Upgrade the tooltip documentation to the new standards. 2019-12-21 21:20:11 -08:00
Emmanuel Lepage-Vallee 0393c93f42 doc: Upgrade the wibar documentation to the new standards. 2019-12-21 20:58:53 -08:00
Emmanuel Lepage-Vallee 6e4eb134b0 doc: Upgrade the `awful.popup` documentation to the new standards. 2019-12-21 13:39:46 -08:00
actionless 75e5b8b39b refactor(hotkeys: vim): don't add each group rule manually 2019-12-19 11:42:27 +01:00
actionless db9334605a fix(hotkeys: vim): don't use hardcoded colors 2019-12-19 11:38:46 +01:00
actionless a3b4e07415 chore(hotkeys: vim): add fold-related 2019-12-19 11:37:24 +01:00
Emmanuel Lepage Vallee a4e463fd55 awful.mouse: Move more code into submodules.
Just like 5 years ago, the dependency mess caused by the giant
`awful.client`, `awful.tag` and `awful.placement` requires to
split the code into small files with less dependencies and include
those.

In this case, the goal is to use the `awful.mouse.client` functions
from `awful.client`.
2019-12-06 01:25:08 -05:00
Emmanuel Lepage Vallee 1fe90513be placement: Do not depend on `awful.layout`. 2019-12-06 00:51:54 -05:00
Emmanuel Lepage Vallee 44cdde57a9 awful.mouse: Do not depend on awful.layout.
It was only used to check if its the floating layout, there is a
less intrusive dependency to check that.
2019-12-06 00:51:54 -05:00
Emmanuel Lepage Vallee 0d1b34e54a placement: Remove a nearly unused dependency.
`awful.client` was only used once and the function exists as a
screen method. This will help untangle the dependencies a bit...
To tangle them even more after that...
2019-12-06 00:51:54 -05:00
Emmanuel Lepage Vallee 36999de123 placement: Stop detecting screen objects using `type(o.geometry)`.
All object type will now use tables instead of function, so this
check will break.
2019-12-06 00:51:54 -05:00
Emmanuel Lepage Vallée d2b7d292b0
Merge pull request #2939 from SethBarberee/layoutbox-doc
Add layoutbox example
2019-12-06 00:18:24 -05:00
Seth Barberee 431791accc add layoutbox example 2019-12-05 23:48:55 -05: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 1f604a73c9 awful.key: Support multiple keys per `awful.key` objects.
This allows to support the arrows, numpad or numrow using a single
object. This will simplify some code, including `rc.lua`.
2019-12-05 22:48:56 -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 8b6ea8243a awful.mouse: Add a function to remove a default client button. 2019-12-05 22:45:05 -05:00
Emmanuel Lepage Vallee 7dfd32e4ba awful.keyboard: Add a function to remove a key from the default set. 2019-12-05 22:45:05 -05:00
Emmanuel Lepage Vallee 80c65c5175 awful.mouse: Add a `append_mousebindings` function.
To preserve the symetry between the `button` and `key` API.
2019-12-05 22:44:13 -05:00
Emmanuel Lepage Vallee 370e754006 awful.mouse: Add a function to add a new `awful.button`s to clients. 2019-12-05 22:38:14 -05:00
Emmanuel Lepage Vallee a8e8c46b56 awful.keyboard: Add a method to add a default client key.
This is the first commit of a new API to add and remove buttons
and keys from clients. The goal is to get rid of the default `rc.lua`
"hardcoded" list of client buttons and keys to allow modules to modify
the defaults. This is part of the larger effort to make `rc.lua`
modular.
2019-12-05 22:32:00 -05: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
Seth Barberee 7440cf66f0 more docs for launcher (#2935)
Co-Authored-By: Aire-One <Aire-One@users.noreply.github.com>
2019-12-04 00:08:40 -05:00
mergify[bot] a0386dad91
Merge pull request #2921 from Aire-One/doc_fix_modules_summaries
[Draft/Proposal] DOC - Fix modules summaries.
2019-11-29 06:22:34 +00:00
mergify[bot] d52e332b96
Merge pull request #2928 from Aire-One/doc_screen_images
[Documentation] `screen` module - Improvement on generated image: client part.
2019-11-28 22:18:31 +00:00
Aire-One 82a2769e04 Fix ldoc modules summaries missing the final `.`. 2019-11-28 13:53:59 +01:00
Aire-One fcc3d0b590 Add an option to draw clients.
Change how wibox are drawn to build a more flexible function reusable in the context of clients.
Add `clients` option to the template. This new option needs an associative table `{ ['label'] = client }` to work. Where label will be a text rendered on the middle of the client area.
Add a new example: `texts/examples/screen/tiled_clients.lua`.
2019-11-28 13:31:21 +01:00
Uli Schlachter 8d2c986936 Emit property::screen in tag:delete()
Before this commit, the code directly modified the table where the tag's
properties were saved. This commit changes the code to call
awful.tag.setproperty() instead. This function ensures that
property::screen is now also emitted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-11-27 01:39:11 -05:00
James Reed 1e71d9afbd
Update taglist more aggressively 2019-11-20 10:52:55 -07:00
Emmanuel Lepage Vallee ee331a4eff keygrabber: Remove the hardcoded way to add keybindings.
There is now a real API for this.
2019-11-09 16:43:53 -05:00
Emmanuel Lepage Vallee e3959b45d5 awful.button: Keep track of the `awful.button` in the `capi.button`. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 42a906f300 capi.button: Enable the miss handlers. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee fe603f7dc5 capi.key: Enable the miss handlers. 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 025262fd95 doc: Use the new doc convention.
The previous few commits are very old, bring them to the new
standards without all the merging conflicts (which are error prone).
2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 02486b3479 awful.key: Add a has_root_binding property and :trigger() method 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 4f7388dd17 awful.button: Add a has_root_binding property and :trigger() method 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 93b90026e9 root: Add a `has_key` and `has_button` functions. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 86d8ef3142 awful.button: Turn into an object. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 21ae9c1edb awful.key: Turn into an object. 2019-11-09 16:43:12 -05:00
Emmanuel Lepage Vallee 4501f0e768 Allow to add and remove keys and buttons.
Another step in moving these APIs toward the common object oriented and
declarative paradigms used by other APIs.

This commit introduces the `awful.keyboard` module. It currenly only
exists as a placeholder for the first few append/remove function, but
will grow in scope in another pull request to expose the currently
private modifier APIs and to provide keybindings collision detection
and replace some of `awful.hotkey_popup` business logic.

The `keygrabber` tests which uses root keybindings are disabled for
now to keep the commit size small. This is necessary since the shims
will need many iterations of changes before this work again with the
new syntax.
2019-11-09 16:42:06 -05:00
Emmanuel Lepage Vallee 4dbc83fa7d doc: Modify the template to allow merging sections.
It might not be the most pretty of change, but it works. With this
change, it is possible to have multiple "things" in the "same"
section having the "same" name.

This allows for C/C++ style functions with the same name but different
signatures. Lua doesn't handle this well, so it should usually be
avoided. However, constructors might be a valid exception. Most older
widget (and object) constructors have multiple random argument while
newer one use `args`. Deprecating the old ones for the sake of
standardization might be a bit too much for users upgrading from v3.5.

Given the only reason all of those deprecation would happen is because
"its pretty that way", then lets allow 2 constructors and avoid outrage.
2019-11-03 01:28:29 -05:00
Xinhao Yuan 8beb0286ea Fix: toggling the `maximized` state properly when a client requests to unmaximize.
The fix focuses on ewmh.merge_maximization function, which handles client intentions to change maximization states.
The fix includes:

  1. Fixing the `get_value` helper function to return the proper resulting state that client wanted to change.
     For example, when `c.maximized and not c.maximized_horizontal and not c.maximized_vertical` holds,
     the client would observe the `MAXIMIZED_VERT` and `MAXIMIZED_HORZ` atoms in X11, but get_value would compute
     the result values based on `c.maximized_{horizontal,vertical}`, which are all false. The fix makes the computation
     consistent to clients' view.

  2. Interpret a client's maximization intentions based on the client's view of how the X11 atoms changes.
2019-10-16 18:23:18 -04:00
mergify[bot] 344964a44a
Merge pull request #2529 from actionless/hotkeys-popup-dont-show-empty-groups
fix(awful: hotkeys_popup): don't show group label if group itself is empty
2019-10-12 22:14:48 +00:00
actionless beb54c7d5f fix(awful: hotkeys_popup): don't show group label if group itself is empty
1) factor out grouplabel-related logic into _create_group_columns() method
2) check the number of keys in group before calling that method
2019-10-11 15:31:57 +02:00
streetturtle 1b79dec685
Fix typo and wrong property name in popup docs
Fix typo: maxmimum -> maximum and fix wrong name of the property.
2019-10-07 21:45:41 -04:00
Emmanuel Lepage Vallee 2c08c2fa39 quality: Port all legacy `:buttons()` to `.buttons`. 2019-10-06 03:50:56 -04:00
Emmanuel Lepage Vallee ab1e62a332 Remove the instances of :buttons(awful.button()).
Having buttons without an awful.util.table.join/gears.table.join
has never been officially documented to be supported. I hope there
isn't too many of those and they wont try to mix the new and old
API syntax, because that will totally break.
2019-10-06 03:50:56 -04:00
Emmanuel Lepage Vallee 57f38f4824 layoutbox: Deprecate the old constructor 2019-10-05 22:57:05 -04:00
Emmanuel Lepage Vallee 82db9180b1 widget: Mutualize all set_widget implementation to behave the same
Now always call both check_widget and make_widget_from_value. This
should make it a lot less confusing when randomly trying to create
a widget as all ways to do it slowly converge toward an unified
one.
2019-10-05 22:57:04 -04:00
Emmanuel Lepage Vallee 349b75994f titlebar/wibox: Support widget definition in set_widget.
So now it is mostly identical to `:setup()` beside some legacy
difference in how the get_children_by_id is implemented.
2019-10-05 22:57:04 -04: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 f747438879 layoutbox: Modernize the constructor.
Another step in the long running project to unify all constructors
design.
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 3d918258e2 widget: Turn `:buttons()` into a normal property. 2019-10-05 18:06:51 -04:00
Emmanuel Lepage Vallee 3230a41450 root: Turn root.button() into a property.
This is the first commit of a series to turn all function based
accessors into object properties. This will bring consistency
across the codebase.
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 0cb22fd203 awful: Move the backward compatibility code into its own file.
The reason for this is that as more of CAPI is brought in line with the
current API guidelines, it is more and more likely the tests will hit
APIs shims (either to test them or because the prototype remains the
same and only the implementation moved to Lua).
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallee 96c4d001f1 doc: Remove capi.button/capi.key from the official doc.
`awful.button` is always the one used and it's confusing.
2019-10-05 18:06:50 -04:00
Emmanuel Lepage Vallée ffe7c4d1cc Apply suggestions from code review
Thanks to @Aire-one for those fixes!

Co-Authored-By: Aire-One <Aire-One@users.noreply.github.com>
2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee c2a2c789e6 doc: Add example sequences for the tags. 2019-10-05 17:16:22 -04:00
Emmanuel Lepage Vallee cb88776980 screen: Add diagonal size (in inches and millimeters).
The use case for this will be to detech which screen is connected to
an output from the screen rules.

It is in millimeters because this is what the output provides and in
inches because the DPI is based on that unit and screens are sold with
the size in inches on the box.
2019-09-30 00:49:40 -04:00
Emmanuel Lepage Vallee 93799e8be3 dpi: Better filter the viewports.
Identical viewports are already handled before getting into Lua,
but sometime xrandr gives another viewport that encompass all
others. It has to be removed.
2019-09-30 00:49:40 -04:00
Emmanuel Lepage Vallee aa76b11b81 screen: Move the "added" signal from CAPI to Lua.
When the screens are created from the viewport in Lua, the signal is
sent too early and the DPI and outputs have not yet been added. This
cause the `connect_for_each_screen` callbacks to be called with a
partially initialized screen object. It also causes the drawables to be
repainted too early.

CAPI now emits "_added" and "awful.screen" takes care of emitting
"added".
2019-09-30 00:49:39 -04:00
Emmanuel Lepage Vallee 3e19251d14 screen: Set the managed flag when creating screens in awful.screen. 2019-09-30 00:49:17 -04:00
Emmanuel Lepage Vallee cd6998b18d screen: Delay the request::wallpaper and desktop_decoration for the DPI.
With this, there is plenty of palces where the DPI can be set before
those signals are sent. This allows wallpaper with the proper DPI to
work with screens created using `fake_add`. In turn, this will allow
screen rules to control the DPI. In "the past", the DPI used for those
handler was the native DPI of the screen with no opportunity to change
it before hand.
2019-09-30 00:48:09 -04:00
Emmanuel Lepage Vallee 1e1cd549c6 screen: Add a `:split()` method.
This is easier than messing with the `fake_resize()` method. This will
eventually have an awful.screen.rules equivalent to auto-split the
screen from the rules.
2019-09-29 19:07:24 -04:00
Emmanuel Lepage Vallee b0f18bce52 screen: Allow `outputs` to be changed.
This moves the handling of the `outputs` property away from C and into
Lua. It will allow the use of `screen.fake_add` to have outputs.
2019-09-29 19:07:24 -04:00
Emmanuel Lepage Vallee 51e3d66110 screen: Fix enough issue when all screens are removed to pass a test.
This doesn't mean removing all screens is supported. It isn't and never
will be. The only reason this commit exist is to allow some
initialization and error handling code to be tested.
2019-09-29 18:56:06 -04:00
Emmanuel Lepage Vallee 852ff9c340 screen: Add a fallback code path when --screen manual is used.
If there is no handler, then the fallback will create the screens.
2019-09-29 18:56:06 -04:00
Emmanuel Lepage Vallee dcdbc679f7 doc: Add a file to ldoc blacklist before addint it.
Add `dpi.lua` to config.ld even if it isn't added yet. This is
because the way the test run has it cached in the build dir. A full
rebuild would take too long and timeout on travis for semi-large PRs.
2019-09-29 18:19:45 -04:00
laith-m0 e1169e864d propmpt: Rename `args.hook` to `args.hook` for consistency. 2019-09-29 17:09:01 -04:00
Emmanuel Lepage Vallee 602d6ded07 doc: Add some images to represent the various area of a screen. 2019-08-19 01:48:00 -04:00
Emmanuel Lepage Vallée b2ebf899d7
doc: Fix a broken reference. (#2850) 2019-08-12 00:31:41 -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
mergify[bot] 88e51faa87
Merge pull request #2833 from DorianGray/patch-1
awful.tooltip:show() - swap timer.started and timer_function call
2019-08-02 15:01:02 +00:00
Sergey Vlasov 29f1719026 awful.titlebar: Fix GC for titlebar widgets (#2830)
Some titlebar widgets (`awful.titlebar.widget.titlewidget`,
`awful.titlebar.widget.button` and other specific button widgets) could
not be garbage collected until the associated client was unmanaged,
because the signal connection used to update the widget was never
destroyed, and the signal handling function was keeping a reference to
the widget in its environment.  This resulted in high memory usage when
the titlebar widgets were recreated multiple times for the same client
(this does not happen with the default Awesome configuration, but may be
needed for dynamic titlebar reconfiguration in a custom config).

Modify the code to use weak tables instead of direct signal connections
to avoid keeping strong references to widgets.  The widget update
functions still keep strong references to the widget itself (creating a
reference loop, but the Lua GC should handle it correctly) and the
client object, but this should not be a problem.

One publicly visible change is that `awful.titlebar.widget.titlewidget`
now has an `update` function, like the button widgets.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2019-07-22 11:12:16 +03:00
Robert Andrew Ditthardt 0b58cf9941
awful.tooltip:show() - swap timer.started and timer_function call
This is needed because if async code is run inside of a tooltip timer func the started property may not still be false.
The current version causes random spurious timer already started errors.
2019-07-21 19:07:33 -04:00
Emmanuel Lepage Vallée 0ac0a77aab
Merge pull request #2811 from sigprof/no_overlap-unselected-tags-v2
awful.placement: Fix no_overlap with unselected tags
2019-07-10 17:20:27 -04:00
Emmanuel Lepage Vallée c89c18c989
mouse: Do not display the snap helpers when a client isn;t floating. (#2818)
It is still enabled for floating clients or when the floating layout is
used.

Fixes #2813
2019-07-10 17:16:41 -04:00
Sergey Vlasov 93c4f369cf awful.placement: Fix no_overlap with unselected tags (#2809)
The awful.placement.no_overlap function always looked at the currently
visible clients when placing a new client.  This produced a confusing
result when using awful.rules or the sn_rules argument of awful.spawn to
place the client on an unselected tag (the client was placed as if it
would be placed on a currently selected tag; if multiple clients were
placed on the same unselected tag, in many cases they were placed at the
same position, overlapping each other).

Make awful.placement.no_overlap check tags of the placed client and
handle the case of placement on an unselected tag in a more useful way:

  - If the client is sticky or at least one of the client tags is
    selected, keep the previous behavior: avoid overlap with all other
    floating clients which are currently visible, and use the currently
    active layout to determine the floating status.

    An explicit check based on `c:tags()` is made instead of using
    `c:isvisible()`, so that the previous behavior is kept even if the
    client is hidden or minimized for some reason.

  - If all client tags are unselected, avoid overlap with all other
    floating clients which either are sticky or share at least one tag
    with the placed client, and use the layout of the first tag of the
    placed client to determine the floating status.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2019-07-04 16:42:15 +03:00
Emmanuel Lepage Vallee 90a29f92eb doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -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 11d7a614d9 doc: Add a constructor stereotype for everything.
This forces the constructor functions to be at the top of the API
documentation rather than in a random position.
2019-06-08 18:13:42 -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 f1dceb02f6 doc: Move all popups to a section. 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
Emmanuel Lepage Vallee bb51add089 doc: Move all widgets to a new section. 2019-06-08 17:49:14 -04:00
Emmanuel Lepage Vallee e9d4164851 doc: Move all containers to a new section. 2019-06-08 17:49:14 -04:00
worron 5fef354892 Fix instance existing check for application spawn (#2774)
User defined matcher now has higher priority while checking
existing instance for application spawn.
2019-06-08 16:09:37 -04:00
fREW Schmidt 900cca54a4 Correct name of functions in taglist (#2783) 2019-06-08 16:09:02 -04:00
fREW Schmidt 099f17ca8c Fix name of max layout in docs (#2781) 2019-06-08 16:08:30 -04:00
fREW Schmidt 021bf689d7 Replace doubled immobilized with correct properties for each immobilized (#2770) 2019-05-25 06:17:26 -04:00
Emmanuel Lepage Vallée f03d5474cb
keygrabber: Fix the key sequence recording. (#2758)
The origial implementation was broken and nobody noticed until now.

Fix #2757
2019-04-24 20:15:39 -04:00
zsugabubus c9a6f6f994 keygrabber: Fix optional "release" handling (#2756)
Even thought `awful.key` handles optional "release" parameter well,
parameters are also get used before passing them. In case (only)
optional "data" is provided, it faulty gets called on a release event.
2019-04-23 23:12:03 -04:00
Emmanuel Lepage Vallee 93c6222da4 screen: Add two new requests.
* Add a request to handle the wallpaper when a screen is added or
   resized.
 * Add a request for screen decorations such as bars or gizmos when
   a screen is added.

Both are also sent when a new handler is connected.
2019-04-15 15:26:50 -04:00
Emmanuel Lepage Vallée df0cdbed61
Merge pull request #2600 from Elv13/extract_rules
Extract the awful.rules logic into a gears module
2019-04-15 13:28:48 -04:00
Uli Schlachter 9085ed6312 awful.remote: Protect against error(nil) (#2748)
Fixes: https://github.com/awesomeWM/awesome/issues/2747
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-04-14 12:34:52 -04:00
Emmanuel Lepage Vallée dc1f87ef84
Merge pull request #2738 from Elv13/doc_tests_and_notif_p5_1
Split the reviewed groundwork commits from the notification widgets pull request
2019-04-13 12:57:58 -04:00
Emmanuel Lepage Vallée 4440c5c1d5
keygrabber: Allow multiple instances to be created during the same loop. (#2741)
Due to a facepalm caliber mistake, the wrong self was being used...

Fixes #2712
2019-04-07 19:09:49 -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 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 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 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
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
Emmanuel Lepage Vallee 29d89c5e8a placement: Handle when the preferred position isn't set.
This removes a FIXME from the code.
2019-03-04 15:52:39 -05:00
mergify[bot] 3ff795b4fc
Merge pull request #2716 from psychon/once_optional_rules
awful.spawn: Make rules optional in once / single_instance
2019-03-03 21:20:10 +00:00
Uli Schlachter 244932749b awful.spawn: Make rules optional in once / single_instance
There is not much good reason why this should be required and making it
optional is almost trivial, as this patch shows.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-03-03 08:52:31 +01:00
Uli Schlachter 731e4736e5 Do not recommend io.popen()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-27 10:26:16 +01:00
Daniel Hahler 36d7535cd5
Minor: typos, Makefile aesthetics (#2690)
* lib/awful/mouse/resize.lua: s/extendable/extensible

* Fix code comment typo: s/find/found

* Makefile: remove -n with echo

Missed in e9b5e28d1.
2019-02-22 08:42:43 +01:00
Emmanuel Lepage Vallee 1b567cc06a notification: Rename text to message
There is many "text" and the default text is the title, not the body.
2019-02-16 15:26:38 -05:00
Emmanuel Lepage Vallee 9df77e5c76 naughty: Move the notification object into its own file.
Mostly for the documentation, but also as the new base upon which
to build the modular notification GUI.
2019-02-16 15:25:10 -05:00
warptozero eca5c869fa
awful.rules: Fix shape function not being set as client property 2019-01-30 07:44:00 +01:00
Emmanuel Lepage Vallée 8b5d79792b
doc: Fix a copy+paste mistake
The current `awful.widget.layoutlist` is a fork of the so far uncommitted `naughty.widget.actionlist`. It was created because some of the support code for the new `naughty` implementation needed "easier to merge" usage examples. The `layoutlist` was chosen because it was both a low hanging fruit and genuinely useful.
2019-01-27 22:01:10 -05:00
Emmanuel Lepage Vallée f735a60b95
Merge pull request #2511 from Elv13/xmas_2k18_5
Add the layoutlist
2019-01-26 12:22:03 -05:00
Sorky bf62695f76 awful.menu: Move code from rc.lua to awful.menu
Fixes: #2524
2019-01-26 12:19:05 -05:00
Emmanuel Lepage Vallee 8b60c05118 widget: Add a layoutlist widget
Like taglist and tasklist, but for layouts
2019-01-26 01:34:59 -05:00
Emmanuel Lepage Vallée 7e7733c6d1
Merge pull request #2521 from Elv13/modifiers
awesome: Add a `modifiers` field.
2019-01-24 23:59:54 -05:00
Emmanuel Lepage Vallée c87e7aad56
Merge pull request #2510 from Elv13/xmas_2k18_4
Add the popup widget take 2 (only relevant commits)
2019-01-24 23:24:22 -05:00
Emmanuel Lepage Vallee 031c773658 popup: Add a popup module to awful
This module is half way between the tooltip and the raw wibox.

It supports the following features:

 * Auto resize to its widget size
 * Support parent objects and placement

Fix #1683
2019-01-24 10:58:45 -05:00
Emmanuel Lepage Vallee 063ae48438 awful.tag: Select the fallback layout from the list of layouts.
This isn't 100% consistent with the old fallback, but avoids the
case where it has an explicit list to pick from and picks something
else.
2019-01-24 06:31:57 -05:00
Emmanuel Lepage Vallee 831e92410e tag.layouts: Skip get_layout when looking for the current layout.
If the `layouts` are set during initialization, `t.layout` will
return `floating` if `t.layouts` is added before `t.layout`. By
using the raw layout, the fallback doesn't kicks in.
2019-01-24 06:31:57 -05:00
Emmanuel Lepage Vallee 2892648916 awful.layout: Add a deprecated notice.
It was already deprecated, but this wasn't documented and silently
fixed.
2019-01-24 06:31:57 -05:00
Emmanuel Lepage Vallee eb3ca746ca awful.layout: Support the current tag layouts in `.inc()`.
Also "modernize" the code by leveraging gears.table for more logic.
2019-01-24 06:31:57 -05:00
Emmanuel Lepage Vallee 0d80b3f0e9 keygrabber: Do not try to guess the modifiers name
There is no an API to query the correct value

Fixes #2515
2019-01-21 03:14:26 -05:00
Emmanuel Lepage Vallee 4b76ca9d38 doc: Fix awful.hotkeys_popup.show_help formatting. 2019-01-13 23:57:04 -05:00
Sorky cf5b0b51ef Update awesomerc.lua
Alternative fix for hotkey_popup via awful menu showing on wrong screen
2019-01-13 23:50:58 -05:00
Emmanuel Lepage Vallee eb8bfa6407 doc: Fix a copy/paste mistake in the screen module 2019-01-05 04:32:37 -05:00
mergify[bot] 6d2fc5c12b
Merge pull request #2523 from Elv13/compact_doc
doc: Merge some documentation pages
2019-01-03 12:50:21 +00:00
Daniel Hahler f7c144f365
doc: fix type for cmd with easy_async_with_shell (#2531)
It only accepts a string.

With a table it will return an error (string):

> "spawn: parse error: Non-string argument at table index 3"

[ci skip]
2019-01-03 13:46:11 +01:00
Emmanuel Lepage Vallee f0df2d6e8f doc: Merge the `termite` hotkey popup doc
The other components are already merged as such.
2018-12-31 17:49:14 -05:00
Emmanuel Lepage Vallée a559f55c6a
prompt: Add a `with_shell` property. (#2500)
Fixes #2486
2018-12-31 15:38:14 -05:00
Emmanuel Lepage Vallee e2f164208c doc: Better document awful.placement.next_to 2018-12-24 21:52:54 -05:00
Emmanuel Lepage Vallee 8bcdd0b794 placement: Add some extra checks to limit the risk of regressions.
Given noone understand this code, this will prevent some semi likely
regressions from going unnoticed. The main risk is the shims not
producing the exact same results as the real implementation and
cause different code paths to be taken.

As of this commit, both the "real" and "shim" implementation were given
the same set of tests with print() at every step of next_to. The
resulting log was then checksummed to ensure both are identical.
2018-12-24 21:52:30 -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 52f62b712c tooltip: Allow the border to be configured.
Given the tooltip border is "client side" instead of X11 to allow
anti-aliasing to work when a shape is used, it doesn't use the wibox
border.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 2b52926b48 tooltip: Pass the parent object to awful.placement, not the position.
By passing the geometry, important information used by
awful.placement.next_to were "lost". Given `next_to` supports both
widget position, the mouse and client/wibox relative positioning, it
has to know the object type.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 68bfde45e1 tooltip: Cleanup the margin API.
Make it closer to other APIs across Awesome.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 3380fd85fc tooltip: Add alignment options.
It's a list of preferred alignments because sometime the best one wont
fit in the screen.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee d8a7782bf4 tests: Add an awful.placement.next_to test
It was overdue
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee 33a39ce38d placement: Make sure `next_to` result is consistent across calls
It depended on a hash `pairs` iteration. This caused an issue only when
the primary position wasn't available.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee f1145af49d placement: Allow to configure the next_to anchors
They were previously hardcoded to match the classic context menu
behavior. It isn't flexible enough for some popup type.
2018-12-24 21:49:52 -05:00
Emmanuel Lepage Vallee 3fa42f3b1a placement: Fix `border_width` for `next_to`
All previous users used client side borders so the issue went
unnoticed. This code will be unit tested by the `popup` module
in a few commits.
2018-12-24 21:49:52 -05:00
mergify[bot] 7d0976912e
Merge pull request #2435 from PeterNerlich/fix-hotkeys_popup
stop keygrabber on hide through click
2018-12-20 04:06:17 +00:00
Yauhen Kirylau 820094c3c4 feat(awful: titlebar): expose fallback title (#2459)
feat(awful: titlebar): expose fallback title
2018-12-17 12:47:14 -05:00
Emmanuel Lepage Vallée de04cecf46
Merge pull request #2454 from Aire-One/add_widget_prompt_params
Add parameters to awful.widget.prompt constructor.
2018-12-17 10:45:54 -05:00
actionless 1da5554fdc fix(hotkeys_popup): rebase fix for keygrabber instance 2018-12-17 16:29:36 +01:00
Emmanuel Lepage Vallée 7231087bdb Update widget.lua 2018-12-17 16:29:36 +01:00
Peter Nerlich e55cc7c912 stop keygrabber on hide through click
fixes #2434
2018-12-17 16:29:36 +01:00
Michele Lazzeri 2308509f39 lib/awful/rules.lua fix requesting nil tag name (#2479)
Related PR: #2354 

We always passed a nil value, guess it's a typo.
2018-11-14 15:23:05 -05: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
actionless b6b6bc0bd6 feat(awful: hotkeys_popup): add args.show_awesome_keys option
Update lib/awful/hotkeys_popup/widget.lua

Update lib/awful/hotkeys_popup/widget.lua

fix(awful: hotkeys_popup): caching issue if showing the same widget instance with and without AwesomeWM hotkeys

doc(awful: hotkeys_popup): extend docstring for args.show_awesome_keys
2018-11-03 17:27:29 +01:00
tototest99 38505a00a2 doc(awful: spawn): Correct a typo in spawn.lua, Fixes #2456 (#2458) 2018-11-02 15:19:31 +01:00
Aire-One 1a96642615 format code and doc 2018-10-31 11:42:36 +01:00
Aire-One bc822c0af7 Add all parameters from awful.prompt to awful.widget.prompt constructor. 2018-10-31 11:35:56 +01:00
Aire-One d5f20a7e0b Add `done_callback` parameter to awful.widget.prompt constructor. 2018-10-31 09:00:18 +01:00
Emmanuel Lepage Vallée 2458f127f3
Merge pull request #2360 from Elv13/add_awful_tag_layouts
awful.tag: Add awful tag layouts
2018-10-22 14:40:16 -04:00
Emmanuel Lepage Vallée aa16d77d15
Merge pull request #2423 from Elv13/better_rules_doc
Better awful.rules doc
2018-10-16 08:44:58 -04:00
Emmanuel Lepage Vallée 35130169c9
keygrabber: Rename release_event to stop_event (#2422)
In the earlier revision of the keygrabber PR, there was a `release_key`
and it was suggested to rename it `stop_key`. However its sibling
`release_event` wasn't, so it is now confusing.

The commit adds a mild deprecation codepath to avoid breaking configs
based on git-master. However it isn't a "long term" deprecation notice
and the code can probably be removed in 5.0 without further delay.
2018-10-16 08:42:56 -04:00
Emmanuel Lepage Vallee 990b1ddb9d awful.tag: Add a "tag centric" way to manage a layout list.
Previously, the layout list was global. However it wasn't covering all
possible use cases and make using `awful.widget.layoutlist` hard since
a layout could be excluded from the `awful.layout.layouts` but still
used for a tag (by setting it explicitly).
2018-10-15 16:10:18 -04:00
Emmanuel Lepage Vallee ae5fc042ae layout: Add a get_tag_layout_index function.
It helps check of the current tag layout is part of

    awful.layout.layouts
2018-10-15 14:21:24 -04:00
actionless 3cef72bb30 fix(awful: rules): don't raise every focusable client on awesome startup
re #2095
2018-10-14 20:41:45 +02:00
Emmanuel Lepage Vallee 43a82f34f0 doc: Add more examples about the spawn.easy_async
Ref #1373
Ref https://stackoverflow.com/questions/52634985/awesome-wm-os-execute-vs-afwul-spawn
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee 845b9a930c doc: Refactor awful.spawn doc to have a property list. 2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b4e0363ac3 doc: Move the awful.rules to the header.
It's easier to find.
2018-10-12 14:19:25 -04:00
Emmanuel Lepage Vallee b49f7e22dd doc: Add an index of valid properties to awful.spawn and awful.rules. 2018-10-12 14:19:25 -04: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] 7020a9707f
Merge pull request #2421 from Elv13/fix_2419
Fix 2419
2018-10-08 16:46:46 +00: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 Vallée 768184d152
Merge pull request #2368 from psychon/motif_hints
Add c.requests_no_titlebar based on motif hints
2018-10-06 22:00:03 -04:00
Emmanuel Lepage Vallee 789cf11d8d titlebar: Emit `request::titlebars` from `awful.titlebar`.
The toggle/show/hide function were incompatible with the current
`rc.lua` is `titlebars_enabled` was removed from the rules because
they were never created. This has always been the case but the
introduction os `request::titlebars` in Awesome 4.0 allows to solve
this longstanding issue. However until now it didn't.

Fix #2419
2018-10-06 18:46:50 -04:00
Alyssa Ross ee9670b1ea Gracefully fail when history file is inaccessible (#2410)
If the history file (or its parents) can't be created, running a command
will fail entirely. Since saving command history is not an integral part
of running a command, it would be nicer if it carried on, just without
saving history. This is what shells usually do.

This patch removes assertions in the history saving function and
instead adds an early return, so if the history isn't saved the command
invocation simply carries on.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2018-10-06 22:53:48 +02:00
Emmanuel Lepage Vallee 021a1feec8 awful.spawn: Add a `raise_or_spawn` method. 2018-10-04 09:16:00 -04:00
Emmanuel Lepage Vallee 0ac99a5dc5 awful.rules: Rename switchtotag to switch_to_tags.
First of all, it select many tags, so there is an "s". Also, Awesome
standardised naming to snake case in v4.0, but this was missed.
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
Emmanuel Lepage Vallee 9250610a77 activate: Add `switch_tag_tag` and `switch_to_tags`.
Also bring some consistency with `awful.rules` naming. A future commit
will add a `TODO v5` to resolve this naming issue.
2018-10-03 08:38:12 -04:00
Emmanuel Lepage Vallee 9e45e016e9 tag.viewmore: Add an optional limit to the number of selection. 2018-10-03 08:38:12 -04:00
Sergey Vlasov 61cdc40595 awful.placement: Fix no_offscreen when composed with other functions
The awful.placement.no_offscreen function did not work properly when
composed with other placement functions; in particular, the default
configuration (awful.placement.no_overlap+awful.placement.no_offscreen)
was broken.  The compose function sets args.pretend=true and puts the
result of the previous placement function into args.override_geometry
before calling the next placement function, but no_offscreen did not use
args.override_geometry, therefore the result of the previous placement
function was discarded.

All other placement functions use `geometry_common(c, args)` to get the
current client geometry; `area_common(c)` should be used only when
getting geometry of other clients.

This change also fixes the problem with margin handling (adding margins
should not affect the window size, only the window position should
change); the test output which was adjusted in commit 0275d3537d
is adjusted again to account for this change.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Sergey Vlasov db11c7e9da awful.placement: Fix client size corruption in no_overlap
The awful.placement.no_overlap function was adding the window border
width to the client width and height (this is performed in
area_common(), which is called by geometry_common()), but did not
reverse this operation by calling remove_border() before returning the
final geometry; because of this, using no_overlap resulted in increasing
the window width and height by 2*border_width.

The bug was probably introduced in commit ebcc19844e (before
that commit no_overlap changed the window position directly instead of
relying on the new placement infrastructure), but was not noticed
because of other problems (e.g., in the default configuration the result
of no_overlap was overridden by the buggy no_offscreen).

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2018-09-13 08:23:36 +03:00
Emmanuel Lepage Vallee 96bbbc82f3 widget.common: Add custom sources for the taglist and tasklist.
The current taglist/tasklist allow filter function to remove elements
from the list. However they don't allow sorting or additional entries
to be listed.

This commit introduced such a concept. It will later be used by the
layoutlist where it becomes more relevant since layouts are used created
"objects".
2018-08-27 00:03:22 -04:00
Uli Schlachter fa1728d749 Add c.requests_to_titlebar
This property is based on Motif WM hints and checks if the client
requests that it is not decorated with a titlebar.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 48d4a31b17 awful.rules: Support titlebars_enabled being a function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-22 14:29:44 +02:00
Uli Schlachter 3f958d60da Merge branch 'master' of https://github.com/mrschyte/awesome 2018-08-22 12:27:05 +02:00
Uli Schlachter 4d6920c165 Merge branch 'rules_tag_by_screen' of https://github.com/psychon/awesome 2018-08-22 12:26:37 +02:00
Uli Schlachter 674cd21b81 Merge branch 'second-try-no-offcreen' of https://github.com/actionless/awesome 2018-08-22 12:26:05 +02:00
Peter Kasza 016be728b1 Remove unsatisifiable condition when destination screen is empty
This commit fixes the following issue: https://github.com/awesomeWM/awesome/issues/2365
2018-08-21 13:19:02 +02:00
mergify[bot] 81da3a2ce7
Merge pull request #2358 from Elv13/add_filter_section
doc: Add filter section for the taglist and tasklist
2018-08-19 07:02:06 +00:00
Emmanuel Lepage Vallee 250475d65c widget.common: Use the new ldoc filter section. 2018-08-18 18:14:24 -04:00
Uli Schlachter 5b45442c73 Fix documentation of awful.menu.new
Fixes: https://github.com/awesomeWM/awesome/issues/2348
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 14:20:31 +02:00
Uli Schlachter ea98919f61 awful.rules: Also check for tag on other screens
When a tag is specified by name, awful.rules only searched for the tag
on the client's screen. This commit extends the search to all screens,
but only if no specific screen was specified for the new client by some
rule.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-17 09:44:29 +02:00
Uli Schlachter 8b5dd10f32 awful.menu: Fix typo "moue" -> "mouse"
The typo was introduced in commit a1941efc9.

Its effect should be minimal: :item_enter() itself does not care about
the 'mouse' option, but it forwards to :exec(). Here, an action is
invoked either if it was not caused by the mouse, or if it was caused by
the mouse and either auto_expand is enabled (which is the default), or
the item-to-be-executed is actually the active item.

In other words, it is quite non-trivial to come up with a case where
this typo made a difference. But of course that's no reason to leave the
typo in.

Fixes: https://github.com/awesomeWM/awesome/issues/2347
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-08-13 10:26:10 +02:00
Emmanuel Lepage Vallee efe82faf1c hotkey_popup: Use awful.keygrabber instead of capi.keygrabber 2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallee 2bf930b044 keygrabber: Refactor to be an object instead of a function.
The old keygrabber API wasn't doing what the users want from a
keygrabber module. With tons of boilerplate code, everything could
be done, but it wasn't trivial.

This commit add a default grabber function that implements the
keybinding API already used by `awful.key` and `awful.prompt`.

It also add syntax candy left and right to make the module "feel"
like a native CAPI object.

Nothing is perfect and some parts, like adding root keybindings, are not
vevy pleasing. However it fulfill its goal when it comes to make
previously non-trivial use case very easy to implement and deploy.
2018-08-06 19:03:25 -04:00
Emmanuel Lepage Vallée aab582c0a0
Merge pull request #2329 from Elv13/fix_minimize_activate
Fix 3rd party toolbar unminimization and the default rc.lua focusable issue
2018-08-03 18:07:50 -04:00
mergify[bot] b9e981ba63
Merge pull request #2327 from laszloth/master
Add a beautiful option to remove borders when maximized
2018-07-30 06:39:38 +00:00
Emmanuel Lepage Vallee 091adca070 activate: Merge the old hardcoded focus filter with awful.ewmh one.
This code was attached to mouse::enter in `rc.lua` instead of being part
of the unified request::activate architecture.

There is currently no way to detach this focus filter because it is
generally correct.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 26e4856821 activate: Raise unfocusable clients.
I am sure there is corner cases where this is considered wrong, but it
allows to simplify rc.lua handling of such clients.
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 69e9cc4cbd request::activate: Unminimize clients
Fixes #927
2018-07-29 18:22:22 -04:00
Emmanuel Lepage Vallee 3c79f1c8d5 awful.key: Add more fields to the description
There is currently no centralized way to manage active keybindings so
the description data case be used to fill part of that role until an
official API is added.
2018-07-29 10:45:40 -04:00
Laszlo Toth 647756fd15 Add a beautiful option to remove borders when maximized
No intended change in previous behavior, so it's disabled by default.
2018-07-28 16:06:57 +02:00
Daniel Hahler 3876b18240 doc: Add missing C-object documentation and fix some papercuts.
Ref: https://github.com/awesomeWM/awesome/issues/1373
2018-07-25 18:26:11 -04:00
actionless 492d07a9cd fixup! fix(awful: placement: no_offsceen): use new placement infrastructure
doc(awful: placement: no_offscreen): update comment and print deprecation warning
2018-07-25 14:31:51 +02:00
actionless fec8d6aa8f fix(awful: placement: no_offsceen): use new placement infrastructure
fix(tests: examples: awful: placement: no_offscreen): uncomment context

fix(awful: placement): common function to remove border from geometries
2018-07-24 07:38:35 +02:00
Yauhen Kirylau 94d3918d14 fix(awful: widget: only_on_screen): update for screen API changes from #2293 (#2304) 2018-07-22 18:33:59 -04:00
Uli Schlachter 3e24303f15 tile: Apply size hints correctly (#2305)
Layouts work with the client's geometry in "space on screen that is
assigned to this client". This means that the geometry should include
decoration (titlebar and borders) and useless gaps.

Everything else (especially the C code) works with client's geometry in
"space that the client can draw on". This means that the titlebar,
borders and the useless gaps are not included into this size.

Thus, when applying size hints, the tile layout has to convert between
these two representations. Otherwise, size hints are applied incorrectly
and to a wrong geometry.

Fixes: https://github.com/awesomeWM/awesome/issues/1418
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-07-21 20:53:30 +02:00
Emmanuel Lepage Vallée 25adaae594
Merge pull request #2266 from ZipFile/fix-no_overlap
Improve no_overlap placement
2018-06-26 10:05:49 -04:00
Uli Schlachter 13984af8aa awful.spawn.read_lines: Shrink input stream buffer when done (#2289)
I do not know how a GDataInputStream / GBufferedInputStream decides
about the size of its internal buffer when reading input by line, but in
issue #2288, an example where the output of date (about 30 bytes) was
read ten times per second caused ten megabytes of memory usage for this
internal buffer. Try to save some memory by explicitly shrinking the
buffer size when we are done reading from the stream.

Reference: https://github.com/awesomeWM/awesome/issues/2288
Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-06-26 09:56:32 -04:00