#415 [lxpanel] draw using cairo

-
closed-accepted
nobody
None
5
2014-11-15
2012-05-11
galtgendo
No

Drawing with cairo will be one of the steps required while porting to gtk3.
Following patch needs a bit polish, but the parts I could test seem to be working correctly (I couldn't test i.e. battery plugin without a laptop).

I decided to not touch wnckpanel, as IMHO it shouldn't have made into master yet:
- unloading it segfaults lxpanel
- WnckPanel is not only *not* a box, but not even a container

Related

lxpanel: lxpanel

Discussion

  • galtgendo
    galtgendo
    2012-05-11

    port (some of) gdk drawing to cairo

     
  • Henry Gebhardt
    Henry Gebhardt
    2012-05-18

    I actually figured out how to make it sharper. It just needs to draw on a pixel instead of between two pixels. It looks really good now.

    Before I make a pull-request that includes your patch, how would you like being credited as the git commit author? The usual format is "Author Name <email@address.com>". I am currently using "galt_gendo <>".

     
  • galtgendo
    galtgendo
    2012-05-19

    When I said "the patch needs polish" I really did mean it.
    First: all of those pixbuf!=NULL checks: functions returning pixbuf may return NULL if they fail, functions returning cairo surface can't, at most they can return an *invalid* surface.
    Second: cairo lines are antialiased by default, if that change doesn't fit, cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE) is (most likely) the solution.

    PS: I wonder why I didn't get the email with the comment...

     
  • galtgendo
    galtgendo
    2012-05-26

    This new patch adds a bit more cairo drawing and fixes a subtle bug in handling alpha (without this patch, if you set alpha to 255, it gets stored as 254).

     
    • status: open --> closed-accepted
    • Group: --> -
     
  • This was included into lxpanel sources long time ago. Thank you very much.