Fast Alpha-Blending In Your GUI
visnu writes: "I've been waiting for this for 2 years now -- a REAL glass-like windowing system. And yes, it's Microsoft to do it. Ever since W2k came out, and they included alpha-blending in the GDI, I was tempted to write a little tool to turn on any window's transparency, but of course I'm way too lazy to do that. These guys weren't though: glass2k runs in the systray and handles turning on any window's transparency. yes, here's a screenshot. I'm not too sure about the speed in W2k, but in XP w/ the newest Nvidia drivers and a somewhat recent video card, it's hardware accelerated, and yes, you should be drooling." Update: 11/26 19:00 GMT by T : Links updated, so hopefully you'll be able to actually get to the content again :)
...but it strikes me as "Not that useful". Most of my users get confused with standard GUI look and feel. I'd hate to think what this would do to their poor little minds.
The simple truth is that interstellar distances will not fit into the human imagination
- Douglas Adams
There might be a very good reason it's taken two years for the glass-like windowing system. And that would be that it isn't a good idea.
Sure it looks pretty. It's technically cool. It's very nice eyecandy. But useful? Hardly.
If our desktops were three-dimensional, there would be a point - in that case you could refocus on a window below your current. When refocusing, the frontmost window would be so blurry to you that it didn't interfere with your view of what was behind it.
But desktops aren't 3D (and "fake" 3D doesn't work, refocusing requires that your desktop is not displayed on a single plane, as that plane only has one focus), and you can't refocus. What you get is just a blur of all windows that happen to be ontop of one another (and the background if you have a background/wallpaper image).
I would guess that the only time that transparent windows help is if you have an OS/wm that does not offer workspaces or similar. The transparency might help cram an extra three windows onto the screen. Using workspaces you can just put those extra three on another workspace instead.
I have yet to see anybody argue how great it would be if all books were printed on plastic rather than paper, so that we could see through them.
The required API's needed to do this in any windows than ME or NT4 is not there. It can be done 'manually', but it is very slow, difficult to do well (I have done it in one of my progs but at the end disabled it when the prog detected the alpha api was not there) and brings problems when running with other programs that alter the way a window is shown.
It is a pretty esy thing to do. For win32 programmers:
1. Find the window handle you want to alpha blend. (say, hwnd).
2. Add the WS_EX_LAYERED extended style to the window with this call:
SetWindowLong (hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
3. Call SetLayeredWindowAttributes. Look up MSDN for the info.
Also, this API in Win2k does not seem to work well in some video cards - windows which update themselves a lot will cause problems i.e. an opengl window, etc (my program has a few of them).
Translucent windowing has also been in Linux; here is an example (not mine; look it up on Usenet). (Warning: Partial nudity.) I don't know how it compares since the site referenced in the article has been slashdotted.