View Full Version : Opacify plugin trunk'ed in beryl, ported to compiz
Kristian
December 21st, 2006, 02:18 AM
http://glug.grm.hia.no/~kristian/beryl/opacify-compiz-03211206.tar.bz2
Opacify reduces the opacity of windows blocking the currently targeted window, and ensures a minimum opacity on the targeted window. This is regardless of focus.
It is tested against current compiz git, but not for long, so I'm not ruling out compiz-only bugs. Feel free to report them if you find them.
Have fun, hope you find this usefull.
mikedee
December 21st, 2006, 02:49 AM
You can generate a schema with this command
COMPIZ_SCHEMA_PLUGINS="opacify" COMPIZ_SCHEMA_FILE="opacify.schema" compiz --replace opacify gconf-dump
Be careful because it appends to the schema file rather than replacing.
If you are distributing a standalone plugin you have to manually edit the schema file by adding these tags at the start and corresponding closing tags at the end.
<gconfschemafile>
<schemalist>
The gconf-dump plugin is not installed by default you have to compile it with --enable-gconf-dump
Kristian
December 21st, 2006, 03:23 AM
Thanks, I actually ran that command but the build apparantly wasn't done properly so I thought it easier to simply ask. New version with opacify.schema upped. (OP modified)
imnotpc
December 21st, 2006, 03:29 AM
Thanks Kristian! :wink:
nzjrs
December 21st, 2006, 06:27 AM
Thanks Kristian. Karma points +1 !
stjepan
December 21st, 2006, 03:21 PM
Doesn't work well with scale...
Is it possible to disable opacify when activation scale?
stjepan
December 21st, 2006, 03:37 PM
It's also quite unstable... some windows stay after closing. It's useless so I just restart compiz then.
Kristian
December 21st, 2006, 04:07 PM
Ah, yes, I made a slight mistake as otherScreenGrabExist has a slightly diffrent effect in compiz than Beryl at the moment and Compiz doesn't have screenGrabExist(), I'll fix it when I'm done cleaning the house for christmas (a few hours... sigh)
Kristian
December 21st, 2006, 04:21 PM
Actually, it's correct.
Can you describe your problems with regards to scale and the instability problems?
stjepan
December 21st, 2006, 05:47 PM
Kristian, with scale, when I hover some windows, some of others go transparent. This causes opacify plugin. Also Firefox menus don't work well wilth opacify plugin.
Please notify us when you fix that.
Kristian
December 21st, 2006, 08:04 PM
Opacify doesn't execute at all if other screen grabs exist unless you somehow trigger a ConfigureNotify event (raise a window for instance), and if you do, chances are you allready triggered an EnterNotify which would detect scale and reset the opacity to the original.
And I've been trying to reproduce this myself without any luck, are you sure you're actually using the version I posted here not the the older one posted by mikedee? Check your installation paths basicly...
The only way I can see this happening is if you're using some other plugin that incorrectly modifies w->opacify (w->opacify should represent the opacity atom at all times).
About firefox menus, this is solved easily by makeing sure the window type that this menu use isn't in the list of window types that opacify touches.
stjepan
December 22nd, 2006, 06:57 AM
Firefox's menus are of type Normal :(
Kristian
December 22nd, 2006, 12:05 PM
Well, then it's not much you can do about that. That's a sloppy solution by the FireFox crew basicly...
mikedee
December 22nd, 2006, 12:08 PM
Well, then it's not much you can do about that. That's a sloppy solution by the FireFox crew basicly...
You need to add a hack like this to your plugin to change the window type.
if (w->type == CompWindowTypeNormalMask && w->attrib.override_redirect)
type = CompWindowTypeUnknownMask; // menu fix hack
Kristian
December 22nd, 2006, 04:54 PM
Ah, yes, I see the problem here. Beryl sets wmType to unknown for windows like that, compiz doesn't. I'll release a fix for that this evening for the compiz version of opacify :)
Kristian
December 23rd, 2006, 02:47 AM
Err, got a bit sidetracked today tracing a longstanding racecondition in Beryl, so I'll have to postpone the fix... It'll be something similar to mikedee's though, just don't want to release without testing anything, and let's face it; svn(or git for that matter) is alot easier to work with than tar balls :)
mikedee
December 23rd, 2006, 05:54 PM
I have just had a quick look through, and here are some of the compiz beryl differences which you might not know about, as well as some comments of mine.
In beryl the GetDisplayOptions and GetScreenOptions all check to see if the display or screen is null. There is no reason why either of these should be null that I can see. It looks like there was a workaround for a bug at some point and it seems to have stuck.
You should initialise your screen and display private variables in the InitDisplay and InitScreen functions. Doing this in the InitOptions functions may cause problems and is hard to follow.
Remember that there are edge windows all around the screen edge. If someone was to activate scale by the corner, then enter the right edge, there will be enter and leave notify's for those windows. It might be causing the scale problems (I am just thinking out loud though).
The InitScreen/Display functions should return false if the memory could not be allocated for your private structures.
The plugin crashes compiz when I unload it, not sure why this is.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.