After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 152991 - CONTRIB PATCH: Enabling transparencies using the window menu or keybind, and turn windows transparent while moving
CONTRIB PATCH: Enabling transparencies using the window menu or keybind, and ...
Status: RESOLVED WONTFIX
Product: metacity
Classification: Other
Component: X extension
2.8.x
Other All
: Normal enhancement
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 325373 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-09-18 10:46 UTC by Sandino Flores Moreno
Modified: 2006-01-07 22:06 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
This is the patch that was linked (14.02 KB, patch)
2004-09-18 15:29 UTC, Rob Adams
rejected Details | Review
Patch what follows Havoc's suggestions (15.13 KB, patch)
2004-09-19 01:43 UTC, Sandino Flores Moreno
rejected Details | Review
This patch enables control over transparency using your scollwheel. (7.88 KB, patch)
2004-09-30 11:22 UTC, Christoph Richter
rejected Details | Review

Description Sandino Flores Moreno 2004-09-18 10:46:41 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.
Comment 1 Rob Adams 2004-09-18 15:29:56 UTC
Created attachment 31668 [details] [review]
This is the patch that was linked
Comment 2 Havoc Pennington 2004-09-18 16:17:11 UTC
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.
Comment 3 Sandino Flores Moreno 2004-09-18 18:18:00 UTC
I'm sorry.
I'm only a newbie and I haven't undertood all the code of metacity.  :-/
:-/
Comment 4 Sandino Flores Moreno 2004-09-18 18:38:52 UTC
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 :)
Comment 5 Sandino Flores Moreno 2004-09-19 01:43:46 UTC
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.
Comment 6 Christoph Richter 2004-09-30 11:20:52 UTC
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.
Comment 7 Christoph Richter 2004-09-30 11:22:29 UTC
Created attachment 32104 [details] [review]
This patch enables control over transparency using your scollwheel.
Comment 8 Michaël Arnauts 2004-12-14 17:52:29 UTC
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!
Comment 9 Rob Adams 2005-05-26 20:41:09 UTC
ok obviously this can't go into mainstream metacity.  Once we have COMPOSITE
everywhere then we'll eyecandify.
Comment 10 Elijah Newren 2006-01-07 22:06:01 UTC
*** Bug 325373 has been marked as a duplicate of this bug. ***