Commit Graph

77 Commits

Author SHA1 Message Date
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
Uli Schlachter 55dee1ea87 magnifier layout: Never manage floating windows (#2046)
The magnifier layout handles the currently focused client specially.
However, if the currently floating client is floating, it should not be
handled by the layout at all. A bug caused the magnifier layout to
handle a focused and floating client anyway if it was the only tiled
client.

Fix this by removing the '#cls > 0'-case. If #cls == 0, then no client
is available to be managed. Thus, cls[1] will be nil, which is fine
since, well, no client is available to be managed. This only made a
difference in the specific bug that I described above. Thus, drop this
case.

Fixes: https://github.com/awesomeWM/awesome/issues/2045
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-09-28 22:56:41 +02:00
Jan Larres 458981710c Treat certain layouts as single client for gaps (#1914)
When gap_single_client is set to 'false', no gap is used when only one
client is shown in a tag. Since the max layout only ever shows one
client at a time it makes sense to apply this setting for this layout
regardless of the actual number of clients in that tag.

Additionally, if the 'master_fill_policy' property is set to
'master_width_factor', then use a gap even if there is only one client
visible and 'gap_single_client' is false.
2017-07-20 21:21:51 +02:00
Uli Schlachter 3bb8efd2db Re-arrange the magnifier layout on focus changes
Just re-arranging on every focus change would cause useless/needless
re-arranges (which have no effect except to waste CPU time). Thus, this
adds a special (undocumented) flag on layouts that makes sure that a
rearrange occurs when the focus changes.

Fixes: https://github.com/awesomeWM/awesome/issues/1799
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-06-09 10:13:14 +02:00
Kevin Zander 3f6df8ddee Fix Luacheck 0.19.0 release Travis breaks 2017-03-03 16:41:12 -06:00
SammysHP 9553f616c0 doc: fix typo (#1430) 2017-01-22 21:57:26 +01:00
Emmanuel Lepage Vallee cefa14d1bd layout: Fix the magnifier layout
It was broken since the dynamic screen support was merged.

Fix #1338
2017-01-04 04:56:54 -05:00
Emmanuel Lepage Vallée 548b15e883 doc: Document the client layouts. (#1247)
This commit doesn't add any useful documentation, but adds
previously hidden documentation variables. It can be the basis
of a better layout documentation.

Fix #1246
2016-12-10 02:24:22 +01:00
Emmanuel Lepage Vallée de121975bf Merge pull request #1165 from psychon/fix-deprecation-warning
Corner layout: Fix deprecation warning
2016-10-10 18:01:32 -04:00
Uli Schlachter 19fe233982 Corner layout: Fix deprecation warning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-10 20:59:49 +02: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 280973c9cb doc: Document all client layout theme properties. 2016-09-26 00:40:20 -04:00
Uli Schlachter 803264a488 Fix magnifier layout when focus is on another screen
The magnifier layout wants to ignore floating clients. Before 82342f0 this was
done by calling awful.client.floating.get(focus). If "focus" was nil, this might
have checked the floating status of a wrong client (if some other client was
focused, and the code in magnifier set focus=nil before). This issue can easily
be missed and might exist since forever. After 82342f, floating status is
checked via "focus.floating" and this now causes an "attempt to index nil value"
error instead. Much easier to notice.

Fix this by adding the missing nil check and while touching the code, merge this
with the previous "if" and correct another error (the wrong thing happened if we
had #cls=0).

Fixes: https://github.com/awesomeWM/awesome/issues/1103
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Emmanuel Lepage Vallee 50da373903 tile: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee ecdcd01dba magnifier: Do not use the deprecated geometry access 2016-09-11 02:10:02 -04:00
Emmanuel Lepage Vallee 693a87ef2e mouse: Avoid an error when the client is killed while moving
to reproduce:

1) spawn an xterm
2) enter 'sleep 10 && killall xterm'
3) start moving the terminal

There will be an error

(found by a yet to be commited integration test)
2016-04-27 19:55:39 -04:00
Emmanuel Lepage Vallee 7654abcedc layout.tile: Avoid negative geometries 2016-04-18 04:20:23 -04:00
Emmanuel Lepage Vallee f9add1c49a awful.tag: Rename nmaster to master_count 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee e8908e2c62 awful.tag: Rename mwfact to master_width_factor 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee dd52f1ce86 awful.tag: Move functions to awful.client and screen 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
Uli Schlachter 798be638d9 Fix this master fill policy stuff
awful.layout.suit.corner does awful.tag.getmfpol(t), but doesn't actually have a
variable t in scope. I just copied the needed stuff from the tile layout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-14 14:43:10 +01:00
Uli Schlachter c75741c578 Fix luacheck warnings for the rest of awful
This fixes *most* luacheck warnings in awful. However, some non-trivial ones
remain for latter.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-11 21:55:32 +01:00
Uli Schlachter 63653bed76 Add the right vim modeline to all lua files
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-12 17:42:33 +01:00
Daniel Hahler 2b2c230f43 Merge pull request #323 from actionless/grow-master
Add "master_fill_policy" tag property and its support in "tile" and "corner" layouts

Closes https://github.com/awesomeWM/awesome/pull/323/files.
2015-09-03 08:53:19 +02:00
actionless b47eabf4f0 feat(lib: awful: layout: suit: tile): add 'resize_jump_to_corner' 2015-08-12 00:12:15 +02:00
actionless d5818d0e1a feat(lib: awful: layout: suit: floating): add 'resize_jump_to_corner' 2015-08-07 18:50:08 +02:00
Daniel Hahler 355e4696ba Preserve old mousegrabber behavior (additionally)
18f6ab1 changed the behavior when resizing floating clients using the
mouse (via modkey + RMB).

Previously, you could initiate the mousegrabber using e.g. "modkey +
RMB", release the key and button, and resize the window using the left
mouse button.

This restores this behavior by canceling the mousegrabbers only if the
cursor was moved, without _any_ mouse button being pressed.

Fixes https://github.com/awesomeWM/awesome/issues/309.
Closes https://github.com/awesomeWM/awesome/pull/310.
2015-07-28 13:09:50 +02:00
actionless 34290433c2 feat(lib: awful: layout: suit: corner): add support for 'master_fill_policy' 2015-07-20 18:32:19 +02:00
actionless fb4a331014 feat(lib: awful: layout: suit: tile): add support for 'master_fill_policy' 2015-07-20 18:32:19 +02:00
actionless 89beaf12e5 fix: rename the rest of *.lua.in files 2015-06-22 11:28:36 +02:00
Julian Wollrath 6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00
Uli Schlachter 75f2f6bf86 corner layout: Don't set geometries directly
Since commit 52ec0ebd93, layouts should return the geometries to their caller
instead of setting them directly. The caller will also fix up the geometries for
border width.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 10:54:59 +02:00
Uli Schlachter a64cd26f62 corner layout: Properly "local"ize variables
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-12 10:52:44 +02:00
Alexis BRENON c2842fe8f3 Add a new tag layout: corner
Closes https://github.com/awesomeWM/awesome/pull/251
2015-06-12 02:18:07 +02:00
Julian Wollrath 939dab8ba9 Some more doc fixes all over the place.
Signed-off-by: Julian Wollrath <jwollrath@web.de>
2015-02-28 23:14:13 +01:00
Ignas Anikevicius (gns_ank) de10f5e4f0 Docs: awful.layouts fixup
Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>
2015-02-28 23:14:11 +01:00
Max 52ec0ebd93 Don't create borders/set client geometry in layouts
Instead, layouts simply store client geometries in a table.
awful.layout.arrange corrects these for border widths and applies them.
2015-02-15 11:25:11 -05:00
Robert Siska 8d7b0feedd Layouts can define their own resizing handler (FS#1267) 2014-10-23 01:30:19 +02:00
Emmanuel Lepage Vallee 4120e00649 layouts: Allow layouts to be invoked with fake data
This patch allows 2 things to be done:

* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag

The advantages of the former are clear and simple. Those of the later include:

* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
2014-10-13 15:07:31 -04:00
Daniel Hahler fc9284fc53 Drop focus:raise() in magnifier.arrange
This is a useful fix in general, but especially after commit 620732a
(Remove raise call from mouse.client.move).

Ref: https://github.com/awesomeWM/awesome/pull/9#issuecomment-37736135
2014-03-24 17:20:49 +01:00
Daniel Hahler a15e53deec Minor doc fixes 2014-03-15 08:52:14 +01:00
Fabienne Ducroquet 94a8c72596 layouts: spiral: Avoid gaps between windows
When an area is split in two, for example horizontally, one of the windows
should have height math.floor(previous height / 2) and the other
math.ceil(previous height / 2), to be certain that no gaps are left between the
windows.

For instance, if the first window has height h and the second window has height
math.floor(h / 2), the height of the third window should be math.ceil(h / 2)
instead of the same as for the second window.

So to compute the size of window n + 1 it’s necessary to remember the size of
window n - 1 as well as that of window n.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-23 18:39:52 +01:00
Felix Bier e4be0017ff Incorrect calculation of unused size (FS#1108)
Signed-off-by: Felix Bier <flx.bier@googlemail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-02-11 16:10:48 +01:00
Uli Schlachter d13b825c36 Fix warnings from LDoc
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-19 15:35:32 +01:00
Josh Komoroske 8e35e1a6a9 Fixed window gaps in the "fair" tiling mode.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-10 21:48:46 +01:00
Uli Schlachter b552000bd9 More fixes for the recent module() removal
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-17 15:24:01 +02:00
Arvydas Sidorenko b18b504fdf Ported awful.layout.suit to lua 5.2
Tested with lua 5.1: all good

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-16 17:37:30 +02:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Gregor Best f890aa392c layouts/tile: completely fix client borders
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 10:53:47 +02:00