Thanks Uli for testing this. I should have also done it on the default
rc.lua.
mpc is working fine, so it's the lgi/cairo code to blame... (or me, i
suppose).

I have a line :
 cr:translate(dimh/2,dimh/2)
but in the image conception no need to call save() or restore() in the
cairo context  with awesome 3.4.
Indeed, it seems quite différent with 3.5. So i put a cr:save() before and
a cr:restore() just before leaving the draw function.
And now it's ok !

Again: thank you.



2014-04-17 11:25 GMT+02:00 Uli Schlachter <[email protected]>:

> Hi,
>
> On 16.04.2014 20:54, david cobac wrote:
> > Some precisions :
> > it seems it finally interacts but not the whole widget...
> > Since i have two of these widgets side by side, it appears that sensitive
> > area overlaps on the other : it's like the area of the widget is on its
> > bottom right and includes a part of the other widget...
> >
> > A problem of position of the lgi.cairo surface with the widget itself ?
> >
> >
> > 2014-04-16 16:54 GMT+02:00 david cobac <[email protected]>:
> >
> >> Hi !
> >> I've several  widgets defined the same way :
> >>
> >> mpdtw  = wibox.widget.base.make_widget()
> >> mpdtw.fit = function ( mpdtw , width , height )
> >>    local size = math.min ( width , height )
> >>    return size, size
> >> end
> >> mpdtw.draw = function ( mpdtw , wibox , cr , width , height )
> >> ...
> >> ...
> >> end
> >>
> >> None of them react when i define events like this for example :
> >>
> >> mpdtw:buttons(awful.util.table.join(
> >> awful.button({ }, 1, function () awful.util.spawn( "mpc toggle" ) end),
> >> awful.button({ }, 4, function () awful.util.spawn( "mpc seek +2%" )
> end),
> >>  awful.button({ }, 5, function () awful.util.spawn( "mpc seek -2%" )
> end)
> >>   ))
> >>
> >> thanks for any help !
> >>
> >> awesome v3.5.5 (Kansas City Shuffle)
> >>  • Build: Apr 12 2014 19:40:24 for x86_64 by gcc version 4.8.2
> (root@antec
> >> )
> >>  • Compiled against Lua 5.1.5 (running with Lua 5.1)
> >>  • D-Bus support: ✘
>
> Attached is a patch describing my change in the default config. I place the
> widget so that I can find it even though it doesn't actually draw
> anything. :-)
>
> With this, everything works fine for me. I also tried clicking at various
> points
> of the widget and all of them reacted fine.
>
> Could it be that "mpc" fails to connect to mpd? You could try using
> naughty.notify{text="clicked"} in the callback function to test if mpd or
> the
> click failed.
>
> Cheers,
> Uli
> --
> A normal person is just someone you don't know well enough yet.
>  - Nettie Wiebe
>



-- 
Cordialement
                           David Cobac

Reply via email to