Commit Graph

18 Commits

Author SHA1 Message Date
Uli Schlachter 7e395e7bc0 Use memory shorter with awful.client.shape (#2051)
To apply the shape of a client, we have to create an image and draw the
shape we want to it. Since clients can be quite large, we have to make
sure that we do not keep this image alive unnecessarily long.

The code in awful.client.shape.get_transformed() however needs another
temporary surface in case the client has its own shape and another one
was set in Lua (side note: currently the code also creates this extra
temporary surface if the client does not have its own shape; that might
be worth fixing). This temporary surface is then used as the source of a
cairo context to draw it to the image that will be used as the client's
final source.

After we are done, the temporary surface is still kept alive since it is
the current source of the cairo context. The cairo context in turn is
only freed when Lua's garbage collector collects it, which may take
quite a while.

Improve this by setting a different source to the cairo context. Thus,
it now releases the temporary surface as soon as possible and it is only
allocated for a short time.

Fixes: https://github.com/awesomeWM/awesome/issues/2050
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-10-07 18:22:50 +02:00
Uli Schlachter efb8134815 awful.client.shape: Finish the shape image when done with it
This function queries the shape of a client and then does something with
it. This commit makes sure the image is finished afterwards, which means
that most of its memory is released immediately instead of waiting for
the garbage collector to collect it.

Related-to: https://github.com/awesomeWM/awesome/issues/1958
Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-08-04 13:13:22 +02:00
Uli Schlachter 130acf1c00 Fix client shape handling
The functions awful.client.shape.update.bounding and .clip handle both
the client's shape and the shape set by Lua. However,
awful.client.shape.update.all only handles the shape set by Lua and
ignores the client's own shape. This can easily be noticed with xeyes.
When update.all ran last and you move around xeyes, the wallpaper behind
it is moved along, because it is not actually outside of the window.

Fix this by partly reverting 1a5f6b7ad2 and having update.all just
call the other two functions again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-02-04 07:20:56 +01:00
copycat-killer 1a5f6b7ad2 client: Allow clients to have shapes
Also fixes awful.client.shape docs

Closes #1507
2017-02-03 17:48:28 -05:00
Luke Bonham ff47b0d0c4 object/client.c: added position and size properties
added client signals connection

added comments doc
2017-02-02 13:09:03 -05:00
Uli Schlachter 2b79165622 Add missing vim modelines in lib/
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-31 14:07:13 +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
cmertz f5f8998d0c use c:jump_to instead of client.jumpto 2016-08-10 13:02:02 +02:00
Emmanuel Lepage Vallee 1ce92bb550 get_rect_by_dir: Move to `gears.geometry`
Begin to break down `awful.util`
2016-05-16 14:03:00 -04:00
Daniel Hahler ad304a2596 Make awful.client.focus.history.list public (#842)
There used to be `awful.client.data.focus`, which was moved to
`awful.client.focus.history.internal`.
While the former was accessible, the latter is not.

This is useful to get a list of most recently focused clients, without
having to hook into the signal yourself.

Closes https://github.com/awesomeWM/awesome/issues/841.
2016-04-26 10:02:23 +02:00
Emmanuel Lepage Vallee 0c1e4e3a2b awful.client: Move `urgent` in their own submodule 2016-04-11 23:54:27 -04:00
Emmanuel Lepage Vallee 587fc1fbb4 awful.client.shape: Turn into a client submodule. 2016-04-11 23:54:27 -04:00
Emmanuel Lepage Vallee fad55a868b awful.client: Move the focus related methods into a submodule 2016-04-11 23:54:22 -04: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 0a21931ffc awful.client.shape: Fix for API change in gears.surface
A nil-value is no longer simply passed through, so this has to do some "special
things" to work properly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-01-17 17:34:44 +01: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
Ignas Anikevicius (gns_ank) 9f8e2b1336 Docs: Begin work on awful.client
This fixes usage and some and client parameter types.
2015-02-28 23:14:11 +01:00
Uli Schlachter e998e3fe20 awful.client.shape: Import client shape handling (FS#1051)
This new awful module reacts to shapes that a client sets on itself and sets the
shape of awesome's frame window to match. This way, xeyes really gets
transparent parts again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-14 10:04:56 +02:00