Dirty hack mania

I got many reports from gmpc users (0.16.x users) that gmpc had a high cpu usage (5-6%).  This turned out to be caused by the GtkProgresssBar I use.

The animations in the progress-bar are implemented by queue-ing a resize request Multiple times a second.  Even though it did not cause a redraw of the whole window (I checked). I could tell the users to ditch the theme, but that is not perfect.

So in 0.17.0 I implemented my own progresbar, this solved the high cpu issue, but this does not integrate.

So today I spend many hours messing with gtk to get a widget, exactly, drawn like a gtkprogressbar but not animated. Using basic themes, this is easy. Just render “trough” box the size of the widget, and then a “bar” and you are done. (beside text). However, many themes beside looking at the detail hint also look at the widget and change the drawing if GTK_IS_PROGRESSBAR matches.  So after some very nasty hacks I have it working.

But I find it kind of sad that I must resort to these type of hacks, because the default theme in f.e. ubuntu and others use completely fucked up (pardon my language) animations..

4 Comments

  • Rasi
    January 17, 2009 - 6:50 pm | Permalink

    Get involved in gtk3 coding! You might save gnome3 to not be a complete mess :)

  • January 17, 2009 - 7:33 pm | Permalink

    With my crappy coding? not likely.

  • January 18, 2009 - 10:29 am | Permalink

    You are doing a great job, thanks! mpd + gmpc is the best audio suite for linux.

  • Lucas
    January 19, 2009 - 10:30 pm | Permalink

    Totally agree with can3p! Keep up the good work!

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>