Commit Graph

52 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 4ea6e133f8 placement: Add some missing `ignore_border_width` checks.
It was done in some places, but not all.
2017-02-07 11:13:15 -05:00
Daniel Hahler aeab2a70e9 Fix whitespace warnings reported by luacheck (#1229) 2016-11-21 22:38:23 +01:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Emmanuel Lepage Vallee 8468d06350 placement: Port next_to_mouse to the new API 2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 211907def2 placement: Add `next_to`
This commit add the last placement function imported from the
Radical module.

It allows to place a wibox/client next to another object. It tries
to find the best fit. It also support wibox widgets.

This is intended for tooltips and menus, but can also be used in
`awful.rules` to place the new client as close as possible to the
focused one without overlap.
2016-08-20 16:21:48 -04:00
Emmanuel Lepage Vallee 19d4a3f602 placement.under_mouse: Fix a rounding error.
When object size contains odd numbers, the result was +1px off.
2016-08-12 17:02:33 -04:00
cmertz 4389297b58 restore client.border_width after fullscreen 2016-07-27 09:54:42 +02:00
Uli Schlachter 0857f6f1b5 Lua: Remove calls to add_signal()
The requirement to call add_signal() was added to catch typos. However, this
requirement became increasingly annoying with property::<name> signals and e.g.
gears.object allowing arbitrary properties to be changed.

All of this ended up in a single commit because tests/examples fails if I first
let add_signal() emit a deprecation warning.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 18:23:48 +02:00
Emmanuel Lepage Vallee aa46b96369 gears.geometry: Add area_remove 2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee 50c97ed167 placement: Add a callback to detach the placement function 2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 21c9766aa6 placement: Fix under_mouse
The function stopped actually setting the geometry...

This was missed by tests because of an oversaw elsewhere.
2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee 45ff7efce5 placement: Support 'attach' in composited placement functions 2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee e78a07574b placement: Do not forward the args in get_parent_geometry
The args are for 'd', not the parent.
2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee c490ca3803 placement: Fix margin support
This was only partially implemented. The margins were substracted from
the area too early in the pipeline. Now, they are added when getting
the size and substracted when setting it. This way, the margins will
"survive" when a placement function set an absolute value in one of
the field. Previously, this caused one (or more) of the margins to
be lost.
2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee 3945f13fc4 placement: Fix an semi-infinite loop when attaching to geometries
It would add a new connection each time and eventually get very
slow.

An regression test will be published later.
2016-05-04 23:47:44 -04:00
Emmanuel Lepage Vallée dbd0931343 Merge pull request #844 from Elv13/geometry_overhaul_p2
Geometry overhaul part 2.5
2016-04-30 23:29:29 -04:00
Emmanuel Lepage Vallee f0546b900d tests: Improve the placement compositing tests 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee 1802e9e2fe awful.placement: Add a `scale` function 2016-04-30 04:27:34 -04:00
Emmanuel Lepage Vallee c286470c17 awful.placement: Port `under_mouse` to the new argument syntax 2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee 2f819df7f7 awful.placement: Add 'offset' argument 2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee e6a04a5922 awful.placement: Extend the compositing feature
It can now keep the different return values and use them in
later chain nodes.

It also add a "virtual" geometry argument so the geometry is applied
only after the last node is executed.

Finally, it fixes using pretend and a composite chain at the same time.
2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee e93e2913b6 awful.placement: Fix a closest_corner corner case
When the mouse was exactly on the right or bottom edge, there was a
rounding error.
2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee 75af0a24c7 awful.placement: Add a 'pretend' option 2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee 75764108e1 awful.placement: Make all functions return the geometry 2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee 3e7a7f23c2 tests: Test awful.placement.resize_to_mouse 2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee 5f17f1aa83 resize_to_mouse: Support size_hints 2016-04-30 04:27:33 -04:00
Emmanuel Lepage Vallee 604ea15c45 awful.placement: Add a 'resize_to_mouse' function 2016-04-30 03:34:14 -04:00
Daniel Hahler 02b6f9893d awful.placement.no_overlap: use screen.workarea as fallback
When there is a maximized and floating client,
`awful.placement.no_overlap` would end up with an empty list of areas to
place the client into.

This patch fixes it to use the default `screen.workarea` in that case.

Closes https://github.com/awesomeWM/awesome/issues/813.
2016-04-26 00:48:19 +02:00
Emmanuel Lepage Vallee fe8beaeaac placement: Fix incorect use of the border_width
The code and tests assumed the border was equaly applied around
the geometry while the {x,y} pair of the geometry include the
border.
2016-04-18 23:56:23 -04:00
Emmanuel Lepage Vallee bfc8f35fb9 placement: Support composition.
Multiple placement function can now be daisy chained like
in gears.matrix. This is useful for building rules.
2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee 2b5d918a8d awful.placement: Add a memento system.
It is used by the ewmh methods.
2016-04-18 23:55:52 -04:00
Emmanuel Lepage Vallee 00d782f3d3 awful.screen: Deprecate functions, add methods 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 82342f055c awful.client: Deprecate .floating.get/set
Begin to formalize the getter/setter syntax into a coherent one
2016-04-11 23:46:10 -04:00
Emmanuel Lepage Vallee 8d95610363 placement: Fix a minor issue with closest_corner
It was using the wrong matrix in 2x2 mode.
2016-04-10 03:27:20 -04:00
Emmanuel Lepage Vallee f7b5240571 awful.placement: Improve documentation 2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee 12c80e3977 awful.placement: Add `maximize` aliases
Use the same conventions as `align` and `stretch` aliases
2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee 7ab83afbbc tests: Test `awful.placement.maximize` 2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee 59b24cbd35 awful.placement: Add a `maximize` method
It should eventually be re-used by ewmh.lua
2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee 19913ba62d awful.placement: Add various `stretch` aliases
Use the same convention as `align` aliases
2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee b4d2a5c541 awful.placement: Add a `stretch` method
This will eventually be re-used by `awful.wibox`
2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee d85b7eb3e5 awful.placement: Add aliases for the `align` method
This re-use the `align` code for the existing `centered`,
`center_horizontal` and `center_vertical` methods. It also
add all the other edges and corners alias.
2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee 456f0bb70c awful.placement: Add `align` method
This allow to place a client, wibox or cursor at the
edges, corners or center of the parent geometry.

This also add code from `awful.wibox` to ajust the workarea.
Future commit will use `awful.placement` to place `awful.wibox`.
2016-03-31 05:04:24 -04:00
Emmanuel Lepage Vallee 5a5f0167cf awful.placement: Add `closest_corner`
This commit also add many local helper functions. They will be
re-used by the next few commits.
2016-03-31 05:04:24 -04:00
Uli Schlachter d56b5c031b Remove some now unnecessary uses of s.index
Because all our Lua code can now work with screen objects, most of the uses of
s.index that the previous patches added for reaching this goal can be removed
again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-27 09:24:19 +01:00
Uli Schlachter 2792fe731e Support screen objects in some of awful
This commits makes a random selection of modules in awful support screen objects
and accept them as parameters everywhere where a screen index is accepted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-26 19:50:17 +01:00
Uli Schlachter c455e1f90e Fix luacheck warnings in half of awful
Boy, awful is huge... Let's better do it in two parts

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-11 21:55:32 +01:00
Uli Schlachter 0be33a0707 awful.placement: Add the border to the client's geometry (#540)
Thanks to the way that X11 works, geometries consider the size of the client
without the border width, but the position of the top-left corner of the border.
This commit adds a new function get_area() which returns the area that is
actually covered by a client. Then, all the code is changed to use this new
function (even the part of the code which did get this border thing correct).

Closes https://github.com/awesomeWM/awesome/pull/541.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-26 23:05:24 +01:00
Uli Schlachter 3d3570a998 awful.placement: Only set position
None of this code wants to resize clients. Thus, it makes sense to only set the
position of a client and ignore its size.

Also, this sneaks in a fix for no_offscreen which is documented to return the
client's new position, but didn't actually do so.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-10-26 23:04:59 +01:00
Daniel Hahler 42aea011d2 placement.no_offscreen: add optional screen argument
This is used by `tooltip.place` then to tie the tooltip to the screen of
the mouse.  Without this, a tooltip from the tasklist might get moved to
the screen above the tasklist, if it gets considered to be on that
screen given its coordinates.

Closes https://github.com/awesomeWM/awesome/pull/437.
2015-09-16 10:39:12 +02:00
Daniel Hahler 66c4ff7f2c doc: awful.placement.no_offscreen 2015-08-14 14:28:17 +02:00