GNOME Bugzilla – Bug 152991
CONTRIB PATCH: Enabling transparencies using the window menu or keybind, and turn windows transparent while moving
Last modified: 2006-01-07 22:06:01 UTC
I'm using metacity 2.8.5, I tried enabling compositor-manager, but it's terrible and unstable. So, I made my own patch: <a href="http://primates.ximian.com/~sandino/metacity-2.8.5.transparent.diff.bz2"> http://primates.ximian.com/~sandino/metacity-2.8.5.transparent.diff.bz2 </a> It enables the following features (tested with xorg-x11 6.8.1): - Window menu has an item to toggle transparencies. - Transparencies can be toggled using an accelerator (default is ALT F6) - Windows are turned transparent when moving/resizing. - Based on transset from Freedesktop's CVS. - New API: meta_window_is_transparent, meta_window_{set|get}_opacity. - Very small, only 4kB. Please, read my patch.
Created attachment 31668 [details] [review] This is the patch that was linked
Comment on attachment 31668 [details] [review] This is the patch that was linked Why the heck would you want to have a keybinding to toggle a window transparent? ;-) formatting of functions should have return type on separate line, space before parens. window_get_opacity() should not round-trip each time, rather the opacity value should be read on initial MetaWindow creation with the other properties, and updated only when it changes. In set_opacity the XSync is not required. Atoms should be interned only once and stored in MetaDisplay, see how other atoms are done. To turn transparent while moving you would want to modify the window in begin/end_grab_op rather than in response to button and motion events. OPAQUE/OPACITY should not be done as #define, OPACITY should be an atom in MetaDisplay, OPAQUE should just use the magic number or use UINT_MAX perhaps, or name it META_32_BIT_OPAQUE Anyway, these are suggestions to improve the patch but I don't think the patch is something that makes sense. Isn't the window opacity hint supposed to be under the control of the application? Not sure if that hint is documented anywhere.
I'm sorry. I'm only a newbie and I haven't undertood all the code of metacity. :-/ :-/
OK, I'm editing what Havoc said. I still think it would be a good idea let metacity change the transparency, opacity. The user is responsable of this. And, it's very practical when you are using applications like xchat, gnome-terminal and gaim. Using transparencies you can see the content of those windows, without obstruct ot blok anyone. It is still my mind. It's just a new little feature :)
Created attachment 31679 [details] [review] Patch what follows Havoc's suggestions Havoc, I have added the changes you suggested. But... I could'n remove the code that makes windows transparent inside MotionNotify callback. This is because the windows have to make tranparents only when a real movement is happening, but display_begin/end_grab_op works in a more general way, even when a simple click on the frame is made (without moving). I haven't undertood metacity's compositor totally, but this patch works better my own experiency.
I really like the patch. It finally make transparency useable. To make the transparency-control more versatile, I've extended the patch: You can now change the transparency by rolling your scrollwheel on the window's titlebar. Be aware that I'm not really a coder and don't understand much of metacity and X, so this could be considered a hack. But I really like the possibility to change a window's transparency with the mouse-wheel and it works really well for me. BTW the new version of the Sandino's patch doesn't work too well for me: When I move a window around, the transparency does snap in with a delay of up to a few seconds, whereas there was zero delay with the initial version of the patch.
Created attachment 32104 [details] [review] This patch enables control over transparency using your scollwheel.
wow! I applied the patch from Christoph Richter, and it's quite awsome :) If this could be included in the main metacity release, wow, that would be... euhm... *speechless* The idea of scrolling in the titlebar to adjust transparanty is really a good idea!
ok obviously this can't go into mainstream metacity. Once we have COMPOSITE everywhere then we'll eyecandify.
*** Bug 325373 has been marked as a duplicate of this bug. ***