Commit Graph

1975 Commits

Author SHA1 Message Date
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