Cimi’s Official Blog

Italians do it Better…

Just a Blog on Gtk+ Theming, Bleeding-Edge, Good Software...

RGBA Colormap by default in GTK+: Call for a Coder 17 February, 2008

Hi Gtk+ hackers ;)

I’m writing this post to see if someone is interested in writing a small patch to make all apps use the RGBA colormap, when available.

The Approach

I’ve discussed few days about *which could be the saner approach* in IRC with thos, ebassi, benzea etc etc.
Of course, same discussion could follow in mailing lists, if you don’t agree with that.
The approach we have in mind can be explained in that way (fell free to correct me if could be better):

  1. Adding a GtkSetting, something like a boolean rgba-colormap = TRUE | FALSE.
  2. Mapping that GtkSetting to an Xsetting.
  3. Reading this GtkSetting before initializing a Window, and here set a RGBA colormap if available.

Using RGBA colormaps will give the Window an alpha value, useful to draw fancy things, from transparent widgets till rounded menus/tooltips.

rgba-murrine-170208.png

Patches are Welcome

Unfortunately I’m not the right man, now, to write that patch. First of all I’m really busy with exams, then I lack of basic GTK knowledge, and this could cost me days/weeks instead an hour of coding :)
I’ve shown you this feature request, here there’s a bugzilla bug too.
If you’re interested in a fancy eye-candy evolution for the gnome world (optional eheheh, clearlooks *is* and *will be* our rockin’ default theme), this patch is essential, since my Murrine (RGBA capable) engine is absolutely stable and ready for the masses :)
A Murrine’s release could follow the Gtk+ release that will have this patch in.

Comments are Welcome

If you have to contribute in a constructive way to the discussion please follow the bugzilla, otherwise feel free to comment here on my blog.


Posted in English, GNOME, GTK, Murrine |

44 Replies

  1. John Stowers said:

    It would be a great compliment to show off our new Metacity with compositing support.

  2. Cimi said:

    With the actual metacity implementation RGBA could be useful to have rounded menus and thing like this.
    It will surely work with an engine like Murrine, but I personally recommend a WM with blur support for transparency (which depends on OpenGL and not Xrender like metacity…)

  3. Mårten said:

    Is it possible not to have the “main” window transparent and just the window-decoration?

  4. Matthew said:

    May I be so self-centeredly offtopic as to ask what actual Metacity and Murrine theme you’re using in that screenshot? I think I already did, so.. thanks.

  5. Cimi said:

    @3:
    Sure
    @4:
    It’s Emerald, not metacity.
    Murrine theme is not available for the current Murrine stable release

  6. K3ks said:

    I really liked to write a patch but i don’t neither C nor GTK+ :(

    @Cimi Is there some other way to contribute? (that has nothing to do with coding)

    PS: Mike Oldfield! Yeah! ^^

  7. K3ks said:

    Ah! I forgot a word! I don’t know neither C nor GTK+.

    Also I just read the bugzilla. If I understood it right, the GTK+ Patch is not needed to have RGBA support for some apps.
    But you wrote:
    “this patch is essential, since my Murrine (RGBA capable) engine is absolutely stable and ready for the masses
    A Murrine’s release could follow the Gtk+ release that will have this patch in.”

    Does this mean, we won’t get (officialy) the new murrine befor GTK+ is not patched? O.O
    and as you said: (bugzilla)
    “But this needs work and a long discussion. I’m not sure it will be added in the
    next months…”

  8. Cimi said:

    @6:
    you can autojoin #murrine in freenode, and follow the development and requests.
    On the other hands, adding rgba on few applications it is very easy, just take a look at murrine website

  9. Max said:

    Just out of curiosity: is blurring (as in, gasp, Vista) doable with this as well? Because that’s a lot more usable and nice looking than plain transparency, imo.

  10. evil_core said:

    @Mårten:
    RTFM, or play wih emerald settings. Its possible from old beryl times :P
    And it doesnt need any GTK patch because window-decorator is not related to gtk.

  11. Étienne Bersac said:

    Hi,

    Congrats for your work.

    Note that i’m unable to determine which windows is focused on the screenshot unless watching the task bar :/

    I’m not used with XSetting API, but i should take an eye on the work needed. I may be able to write this.

    Regards,
    Étienne.

  12. evil_core said:

    @max:
    RTFM too ;) Wherent you never interested what was “blur” plugin in beryl/compiz for ?

  13. Cimi said:

    @9:
    Blur requires OpenGL’s Pixel Shaders… so it depends on an OpenGL window manager like Compiz.
    @11:
    This is because my Window Manager theme sucks :)

  14. simo_magic said:

    cimi sorry but i think i misunderstood
    you have always told that the gtk are argb compliant since a long time ago and you have demostrated too

    but now you say your murrine needs a patch to the gimp toolkit to work and you will release the new murrine only when the gtk patch will be approved

    am i right in every part or have i misunderstood something?

  15. Cimi said:

    @14:
    Murrine works even without a patch into Gtk+, using current Gtk code. Some apps works with this.
    A patch could make things simpler…

  16. Olivier said:

    Hello, just want to say that I’ve just test your new engine (for the moment just the gedit plugin). And it look realy great. Hope we can have this patch soon… and the configurator too. Did someone help you with this since the last post ?
    Apparence is not a useless thing. Niether art. We need beautyfull, clean and pleasant workspace for our everyday — long — time in front of a computer.
    Thank’s a lot.

  17. simo_magic said:

    very good, you cleared my doubt :D

    but now i’ve a question:
    do you think the patch will be applied to 2.22 or only in september with the new gnome 2.24?

  18. Cimi said:

    @17:
    it depends if coders will come

  19. Ian said:

    Hi Cimi. It certainly looks like much progress has been made. I was just wondering:
    Where did the git trunk go?

    (Perhaps I’m a bit greedy and wish to jump the gun a bit, but I would love the eyecandy.)

  20. Sander said:

    I think it went to the gnome SVN server..

    Cimi, can you release the theme for the people using the SVN version, or will you wait until the final release?

  21. Cimi said:

    @20:
    theme does not affect transparency

  22. Sander said:

    I know, I just like it. ;-)

  23. echelon89 said:

    ti prego cimi, non voglio spammare, ma amo veramente il bordo delle finestre che stai usando!
    dove lo posso trovare?
    Grazie

  24. echelon89 said:

    scusami…in realtà mi rendo conto solo ora che amot tutto quello che hai usato nello screenshot :sbav:

  25. Cimi said:

    English please or I won’t reply

  26. zet said:

    @23 it seems to be an emerald theme.

    if I’m wong please correct me.

    Just have a look to italian ubuntu forum to know how to install it, because I think here it’s off topic.

    bye

  27. Sander said:

    Does anyone know how to fix the following error when trying to add transparency to a pygtk application:

    The error was ‘BadMatch (invalid parameter attributes)’.
    (Details: serial 359 error_code 8 request_code 2 minor_code 0)
    (Note to programmers: normally, X errors are reported asynchronously;
    that is, you will receive the error a while after causing it.
    To debug your program, run it with the –sync command line
    option to change this behavior. You can then get a meaningful
    backtrace from your debugger if you break on the gdk_x_error() function.)

  28. Cimi said:

    I’m sure your application has a trayicon, so you just need to push a rgb colormap before drawing the tray, then pop again.

  29. OMANI said:

    Can you translate in italian this post please !?

  30. geek said:

    it’s better to switching to rgba colormap in module

    module source:

    –cut rgba.c–
    #include
    #include
    static GdkColormap *colormap;
    G_MODULE_EXPORT void
    gtk_module_init (gint * argc, gchar *** argv)
    {
    colormap = gdk_screen_get_rgba_colormap(gdk_screen_get_default());
    gtk_widget_push_colormap(colormap);
    gtk_widget_set_default_colormap(colormap);
    }
    –end cut–

    compile into librgba.so, copy it to modules directory and set environment variable GTK_MODULES=”rgba”

    firefox crashes, metacity with compositor crashes, pidgin crashes and pygtk-apps has hardcoded usage rgb colormap default. Some problems with notify-area applet

    (all about murrine-svn)

    so, module need some improvement, like reading env RGBA_BLACKLIST and verify which of applications starting.

  31. Cimi said:

    @geek:
    There’s already a firefox bug opened about their bug.
    All your applications that crash (except firefox and OO) are crashing because of the tray icons, which get Xorg badmatches.
    Tray icons MUST have an RGB colormap.

    Murrine is 100% stable, the problem is in Gtk+, Xorg and fake widgets (firefox)

  32. geek said:

    >Tray icons MUST have an RGB colormap.

    ok,

    >Murrine is 100% stable

    i just mean that testing with murrine-svn ;)

    >the problem is in Gtk+, Xorg and fake widgets (firefox)

    i’ll look in gnome bugzilla

  33. echelon89 said:

    cimi, where I can find that theme? It’s fantastic!
    gtk theme and metacity theme…
    thanks…

  34. pieron said:

    how you getting a blur windows?
    (”blur” compiz plugin work only for window decorations for me)

  35. sandrea said:

    This is really nice, you rock bro. I’m writing a tiny hangman game in python and I successfully added the rgba colormap feature but… In your screenshot I see that the transparency gets blurred how did you do that?

  36. matyy said:

    great stuff. can’t help you tough.

    blur: if you use ccsm, go to the blur settings and set it so that ‘any’ window is blured…

  37. sandrea said:

    @matyy: ccsm? I guess you mean the compiz fusion settings manager and if you do I already tried that but then it blurs all the windows that are not focused, if you take a closer look at the screenshots of cimi’s desktop have blur only on the transparency of the windows making the transparency look less clear…

  38. sandrea said:

    @matyy: I now know that you meant the compizconfig but still I can’t find a way to get the same effect I’m using the ccsm on ubuntu 8.04…

  39. Olivier said:

    You have to uncheck the « Focus Blur » box, and just keep the « Alpha Blur one ».

  40. sandrea said:

    Thanks oliver but I can’t get that same effect, I will try it on another pc maybe alpha blur is not working on ubuntu 8.04

  41. Olivier said:

    I’m under Hardy Heron and have this effet.
    Maybee it’s your graphic card ?
    Did you get the last svn murrine engine and the themes ?

    Sorry, no other idear.

  42. sandrea said:

    Well, I’m using Gutsy Gibbon, my graphic card is a Nvidia FX 5200, svn murrine and the themes are the new human-murrine and a murrine theme I made myself…

  43. sandrea said:

    my bad it is hardy heron

  44. Lox said:

    I just want a transparency for toolbar and scrollbars background is it possible?

Leave a Comment

Attention: Moderation is enabled, and could cause a delay to the posting.

This blog is "Powered by Cimi"

Theme from: Kaushal Sheth | Modified by: Andrea Cimitan