Post a Comment
compiz has nothing to do with GTK, it's a window manager, it's GTK that does the transparency in this case and alot of people want it for pure eyecandy sake.
Many people said for years it couldn't be done or would take a rewrite or something to that effect, they were wrong.
Edited 2007-12-13 19:23
Well it's different from simply controlling the transparency of a whole window: now transparency can be on various elements of a GTK app. See for example the terminals in the second screenshot: the background is translucent, but the text isn't. I certainly can't do that on my compiz here.
Well, gnome-terminal atleast does support real translucent background if you are running a compositing manager such as Compiz-fusion. But you're right, this is not about window translucency, it's about the translucency being applied to single widgets such as buttons, images, scrollbars or whatever the author of the theme wants.
..are not on this front. I always believed GTK's rendering is very flexible, just because it supports different rendering engines since ages.
There are other inflexibilities. For example, there is only one Widget font size. So if you want to have some smaller text, you cannot specify "small" but only hardcode the font (size), which is evil. Perhaps you could do other tricks, like finding out the default font size and do some 80% of it. Still evil, hackish and nobody does that.
See some screenshots of OSX and you get an idea about the huge benefits of different font sizes. Simply not possible with GTK in a clean way.
Wrong. Just set the pango markup.
Here's an example in python:
import gtk
win = gtk.Window()
lbl = gtk.Label()
lbl.set_markup("Hello to <small>small</small> and <big>big</big> textn" +
"You can even <b>bold</b> if you want" )
win.add(lbl)
win.show_all()
gtk.main()
Edited 2007-12-13 19:50
This is simply not true. There are seven different "size" values ranging from xx-small to xx-large, which are all defined relative to the user's chosen desktop font size.
Entirely possible in GTK, and no more difficult than (for example) specifying the use of bold text. I don't know why it isn't used more by application developers, but it's not because the toolkit doesn't support it.
Edited 2007-12-13 23:43
Plasma is going to use it in places. See Aaron Seigo's blog for details. Apparently GTK has some kind of bug in their implementation.
His blog is http://aseigo.blogspot.com/
The relevant posts are:
http://aseigo.blogspot.com/2007/12/argb-visuals.html
http://aseigo.blogspot.com/2007/12/argb-updates.html
http://aseigo.blogspot.com/2007/12/busy-day-doing-apparently-nothin...
I don't really see how this has got anything to do with Qt, but still....
I'll call you. Post a link to a screenshot from 2-3 years ago of KDE3 doing toolkit level transparency (and note that this is not the same thing has window manager level transparency, which is quite different). A transparent button in the middle of an opaque window, or vice-versa, would suffice.
Either do that, or leave the discussion to grown-ups who actually know what they're talking about, okay?
Why do you think GTK+ uses CPU for alpha? It's the compositing manager which does handle drawing the stuff on the screen and they do indeed use GPU for that. GTK+ just properly sets the alpha mask and voila, GPU draws it as it should. Learn a little before you start making such stupid claims.
That definitely depends on how you compiled GTK+ and the theme in question and which version of GTK+ you are using not to mention the version of Cairo, Pango and whatnot.
GTK+ on my machine supports 3D hardware acceleration through Cairo.
That however does not mean that GTK+ on your machine is compiled with support for Cairo or that Cairo is compiled with support for hardware acceleration (OpenGL).
GTK+ on my machine supports 3D hardware acceleration through Cairo.
Mmmno. As much as I personally like GTK+ and Cairo I just have to correct you here: GTK+ devs have not seen it necessary to make Cairo use Glitz for rendering. As such, Cairo (when used by GTK+) does use software rendering. Even if Cairo is indeed compiled with Glitz support it still isn't used unless specified by the application/library utilizing Cairo.
Now what I would find interesting would be a benchmark between normal GTK+ vs. patched GTK+ with Glitz enabled.
True, it requires a composite manager to work. They need cairo compiled with glitz to work, as it is. But without a composite manager it is just waste of good memory and harddisk space.
EDIT: And would a certain person please stop with his consistent down-modding of all my posts? (Not directed at Werecatf) -
Edited 2007-12-15 14:13 UTC
What a blatant liar. It's obvious that since GTK by itself is slow, GTK with alpha blending won't suddenly get faster.
Now I got curious..Where do you get the idea that GTK+ is slow? Cos it can't be as slow as you claim..Why? Well, it's used on a lot of handheld devices which just simply can't sport a high-end CPU. And it's used on several embedded devices too. So, care to elaborate?
And secondly, when GTK+ uses true alpha-blending it will be a lot faster than doing semi-transparency in software. In theory it could just speed up apps which have been doing alpha-blending for their widgets in software. And in practice it most likely would run just as fast as before.
1. If it's already slow in one department, that's not a good reason to make it slow in another department.
2. Do you really think that a naïvely coded directory examination replacement is 120 times faster than GTKs? No, the thing that makes the slowdown is surely the GTK treeview. Those things are slow, and it's got to do with how drawing is handled.
And what makes GTK slow isn't the simple things like that, but drawing and other stuff.
A real world example can be seen here: http://www.purebasic.fr/english/viewtopic.php?t=29336
I'm sorry, I couldn't help but laugh out loud! xD That's about GTK+ file operation speeds!
It has nothing to do with graphics performance :3 Sure, GTK+ may not handle tens of thousands of files very efficiently but I imagine they're atleast trying to fix that sometime. But that is really a bit off-topic since you were complaining about rendering speeds and this article too is about graphics.
Now I got curious..Where do you get the idea that GTK+ is slow? Cos it can't be as slow as you claim..Why?
I'm afraid anyone who has used GTK and Gnome applications long enough knows this. Redrawing is an obvious shortcoming. You also haven't been reading many of Frederico Mena-Quintero's blog entries on tracking down why this might be. Some of the stuff he's been able to find, and managed to do something about, is pretty amazing work. It's very complex stuff though, since it isn't just GTK. A lot has to do with Pango, and various other components and bits of code.
Edited 2007-12-13 23:41
uhm, please don't do this. alpha blending might look nice in screenshots but it's really irrelevant when you start actually using gtk. the text i see in the screenshots are a lot less readable than against a plain background.
it's nice it is possible, but i'm scared the gtk people will use too much alpha and everything becomes a blurred mess (please note that osx uses actually almost no transparency)
but not really usable. Transparent widgets makes text on the widgets harder to read if the background isn't very clean, and it often isn't. Just imagine a popup menu that pops up over other widgets.
One way to improve readability would be to blur the background as well. That way you would get a more calm background for the text. I think Vista does this, but I still prefer non transparant widgets. Transparant widgets look good on a screen shot though.
Does GTK+ provide transparency for widgets in X11, OS X and XP/Vista?
Recent versions of GTK added an "opacity" property to widgets, to allow them to specify how see-through they are (1.0=solid, 0.0=invisible). This is the same on all platforms.
Whether the opacity request is respected or not is up to the renderer, or "theme engine" in GTK-speak. What we've got here is the first X11 theme engine that obeys the opacity requests.
The theme engine for GTK on Windows uses GDI+. I don't know whether GDI allows individual widgets to set their transparency, but if it does then in principal there's no reason why the theme engine couldn't be updated. (More interesting would be an entirely new theme engine based on Windows.Forms... anyone from Novell want to set the cat amongst the pigeons on this one?)
GTK on OS X uses Quartz, which is certainly capable of transparency, but there are some rather higher-priority things they need to get working first I think.
RE[2]: Is this cross platform?
Sorry, you're wrong. As it is stated very clearly in the blog entry you need a compositing manager which draws transparencies. If you aren't running one you don't get transparency even if you try to specify your widgets completely transparent. Besides, for example drawing a PNG with alpha mask in a image widget would still not result in the background showing through unless the app copied an image of the background and blended it with the PNG or unless you had a compositing manager running and widget/window masks and params correctly set.
Just believe me, it is real transparency.
Thanks, I stand partly corrected. I missed the sentence "The translucency effects obviously require a compositing window manager, ..." when I read the text, but I was not entirely wrong, in the sense that if you don't use compiz or another compositing window manager you wouldn't have real transparency. And then it continues "but the theme engine is designed so that the widgets will simply be rendered without transparency when no compositing window manager is present." In other words, that when you would get fake transparency, transparency isn't used. But my post was essentially correct in the sense that RGBA by itself does not provide real transparency.
Thanks again for your corrections.
Well you need something to composite the alpha channel on. X doesn't do this by default and this stuff has to be done in a buffer anyway, unless you want to see windows being composited in front of you as you work. I'm not sure if you know aht RGBA is or not, its not a thin exactly its just a way to describe the alpha channel (hence the A for alpha). RGBA support in gtk+ or any other toolkit, os, etc. always means the final image has to be composited in-order to get true alpha-blending, this can be done 2d through the cpu (though its slow) or through hardware. Compiz uses opengl to do the compositing and thus leverages the power of already built-in support for alpha-blending. The technique whether its OSX or Vista still requires that the windows be buffered and copied off to memory somewhere so that they can be displayed later so regardless of how you look at it a compositing manager is still necessary to do it at reasonable speeds and interactively.
As for how the widgets will be rendered without compositing enabled, my guess is that if there is no compositing manager the engine will only use the color and ignore the alpha entirely, I don't think they'll use that wallpaper hack at all. In other words they will use only the RGB components and ignore the A.
You are wrong. RGBA is basically is two components color and alpha. Compiz by default already supports compositing, gtk+ already has support for RGBA but it hasn't been used extensively until now, but it has been used before for example gnome-terminal uses rgba so that when you use a composting manager it actually use the alpha component as a way to define transparency, this is true transparency you will see eveything under it not just the wallpaper which is a hack that was used before/
The problem of GTK is that it's over-engineered. Conceptually, everything is ok. Every behaviors of the toolkit is well thought. However, the end result is much less exciting. A simple resizing operation causes a zillion fonction calls. Most GTK theme engines are unacceptably slow (the fact that they are almost all based on Cairo now is one of the causes for this). In a corporate environnement, I think people can live with that. For the rest of the world, I think it's not something you want. I have 2 computers here, one running XP and one running Gusty, and I see a huge difference between both setup even when doing the same exact task. For example, SWT/Windows is so much faster than SWT/GTK. Using Eclipse on Windows is so much more enjoyable than using it on Linux. Honestly, having Gnome, Evolution, Firefox, Eclipse and OOo running at the same time isn't something pretty even on a high-end computer. I know we can't blame GTK for everything but it doesn't help.
I think cairo would be sped up considerably if they used the opengl backend to accelerate it liek they planned. If you use gtk on X I think it uses xlib for the rednering backend, but there is no reason why most of this couldn't be offloaded to the compositing manager at some point if it isn;t already being done.
Actually using Cairo speeds up the themes...
Not in my experience, and I doubt benchmarks (gtkperf?) show otherwise. I remember how much slower GTK+ suddenly became after the Cairo switch in 2.6. It was slow in the 2.0-2.4 versions, too, but since 2.6, it's been really slow.
Actually using Cairo speeds up the themes...
I cannot see how, since all the GDK routines are generally faster and more mature than their Cairo equivalents. Cairo hasn't caught up here. GDK is just more mature and faster at bilinear filtering, and stuff like transformations and alike.
I've also seen Cairo's software fallbacks turn out to be terrible really. They're certainly not as good as GDK performance-wise, which is probably why people are talking about doing what they can through GDK now.
There's not really a whole lot of incentive for themes to move wholesale to Cairo, which takes new code, time and effort and may well turn out to not be worth it performance-wise.
100% agreed. GTK+ is painfully slow. Yes, it is a modern toolkit with many modern features, but the performance suffers. It is quite OK for simple apps, but as long as the window layout gets more complicated, with tabs, lists, progress bars, spin buttons etc., it gets quite CPU-hungry. Especially the Cairo integration in 2.6 made it really slow. General (re)drawing performance is poor (and has always been poor in GTK+ 2.x) this can be seen in many graphics apps), switching between tabs in dialogs is visibly slow (I can see the individual widgets being drawn to the tab), resizing has always been slow, scrolling in large lists is slow, context menus are slow (more CPU intensive than in other toolkits) etc.
Yes, using these big apps on Linux (as opposed to MS Windows) is painful exactly because the GUI runs like molasses.
I think it's GOOD that an engine supports transparency. BUT on the other hand this doesn't mean everything has to use this feature until our eyes are bleeding.
This is an unholy trend among UIs. Apple does something, MS is doing it again - to my taste with even more bad taste than apple. Then it finally hits Linux.
Those transparency is bringing NOTHING if it is used for the sake of the effect. I know VERY FEW problems which need transparency. Transparent Menus aren't one of them. This is IMHO simply bullshit, "You can see what's going on underneath" ... Bullcrap. Some
Design an UI, makes it clear, easy on the eyes, don't overuse flashy effects. Don't overuse white (because it's the brightest "color" available on the screen). Make it in the way that the document you're working on is sticking out. UI is just a tool.
Transparency can make sense for drag'n'drop situations e.g.
I can only hope the UI-Designers are coming back to EFFECTIVE UI-Design again instad of showing off their technology. It's just annoying and unprofessional.
Thanks.
So I guess it doesn't count that KDE integrated compositing support for kwin a long while back? Or is it because KDE could only support compositing effects like shadows and transparency, while transparent widgets somehow magically become more effective for UI design?
Who's kidding who, it's bling, nothing more. Just because it's GTK doesn't make it more or less UI effective than KDE/Qt. It's a tool to be used or abused as the devs see fit.
Besides, if you enjoy it, just be grateful for the KDE4 screenshots floating around the interweb, because that's likely what inspired those ten lines of code to be added to enable it in the first place...
Actually, I rather feel that the Murrine author has never taken any design tips from the KDE guys (thankfully), the word Murrine actually means a form of glass-work, so the idea of creating translucent windows will have beem much more influenced by the Aero glass effect than KDE.
Who's kidding who, it's bling, nothing more.
Any form of design above basic functional implementation could be called bling, yet people APPRECIATE this stuff, and (surprisingly, for people like you, I'm sure) hardware and software with good graphical design makes people more productive, and helps them produce better quality products.
Actually I find transparency to be quite a useful feature (if for example you were waiting for something to complete in a shell). It all depends on how you use your desktop. Windows users don't get the concept of virtual desktops but that doesn't mean that they aren't useful. Just because you don't think transparency is useful doesn't mean that the rest of feel the same way. Speak for yourself and leave the rest of us to decide for ourselves. BTW - Apple does NOT invent everything - they just like to claim that they do.
Why is it that any type of desktop compositing is always referenced as "Vista-like". Translucency has been around for a long, long time....way before Vista, and way before OS X. In fact, I distinctly remember a patch for Windows 98 that would allow for translucent window borders and such.
"Microsoft" and "visual innovations" go together like oil and water.
Becuase we are living in the Real World (tm). Technologies get named after the people who make them successfull.
If I say:
Hey, I'm listening to my iPod while travelling up an escalator, on my way to buy a hoover.
a lot more people will understand me than if I say:
Hey, I'm listening to my PMP, while travelling up a motorized staircase, on my way to buy a vacuum cleaner.
If you start talking about patched-windows-95-style transparency, noone will understand you.
If you talk about windows-2000-style transparency, then the geeks will think of whole-window transparency, and fading-in/out windows.
Only Aero-like transparency will create the instant recognition in people's minds that will allow them to correctly identify what you are talking about.
So the word "Vista" has entered our lexicon as being synonymous with "all things computerized and graphical"? Was there a memo that I missed? Is this Steve Ballmer that I'm responding to?
In fact, I distinctly remember the last time I saw rendered water on a PS3, the sentence "Wow, look at that great Vista!" or "Check out that Aero!" was never uttered by anyone in the room.
You're right about things like "Xerox"-ing, and people still referring to PCs as "IBM"s; but I dare you to find ONE single thing that Vista has done, that makes the public use the term ubiquitously, as in calling every "PMP" an iPod.







