On 23.11.2012 06:15, Majic wrote:
> I would like to see how you use this, Arnaud :o  Haven't touched on
> that myself...
> 
> On Tue, Nov 6, 2012 at 8:16 PM, Uli Schlachter <psyc...@znc.in> wrote:
>> On 05.11.2012 15:12, Arnaud VALLAT wrote:
>>> Is it planned to add back a shape / clipping feature like it was before?
>>> I'm looking at the master branch, and there is no such method now, I would
>>> like to have my rounded corners back ^^
>>
>> Done.
>>
>> Thanks for flying awesome airlines.

Here is some really, really, really pointless example that all of you should add
to your rc.lua:

local cairo = require("lgi").cairo
function make_image(size)
        local img = cairo.ImageSurface.create(cairo.Format.A1, size.width, 
size.height)
        local cr = cairo.Context(img)
        cr:set_operator(cairo.Operator.SOURCE)

        cr:set_source_rgba(0, 0, 0, 0)
        cr:paint()

        cr:set_source_rgba(1, 1, 1, 1)
        cr:move_to(0, 0)
        cr:line_to(size.width, size.height)
        cr:line_to(0, size.height)
        cr:fill()

        return img
end

function make_client_ugly(c)
        local geom = c:geometry()
        local clip = make_image(geom)
        geom.width = geom.width + 2 * c.border_width
        geom.height = geom.height + 2 * c.border_width
        local bounding = make_image(geom)
        c.shape_clip = clip._native
        c.shape_bounding = bounding._native
        -- The following isn't necessary (the garbage collector does it for
        -- you), but it saves memory
        clip:finish()
        bounding:finish()
end

client.connect_signal("property::geometry", make_client_ugly)


Cheers,
Uli
-- 
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.

Reply via email to