[compiz] [PATCH] Actions restrictions
David Reveman
davidr at novell.com
Tue Mar 6 11:44:47 PST 2007
On Wed, 2007-03-07 at 00:56 +0100, Vasek Potocek wrote:
> > On Tue, 2007-03-06 at 11:39 +0100, Cedric wrote:
> >> Here a patch to add actions restrictions to core.
> >>
> >> What it do:
> >> - add restrictActionsMask to CompWindow.
> >> - add constrainWindowActions() returning "filtered" window actions
> >> - add changeWindowActions() taking care of restrictActionsMask
> >>
> >> I have do some testing with winrules, seems to works well.
> >> David, maybe you have a better idea?
> >
> > This only allows one plugin to restrict actions. We want to allow any
> > number of plugins to restrict available actions.
> >
> > I quickly added a getAllowedActionsForWindow screen function that should
> > take care of this. Wrap getAllowedActionsForWindow and do something like
> > this in your plugin implementation of that function:
> >
> > static unsigned int
> > pluginGetOutputExtentsForWindow (CompWindow *w)
> > {
> > unsigned int actions;
> >
> > PLUGIN_WINDOW (w);
> >
> > UNWRAP (ps, w->screen, getAllowedActionsForWindow);
> > actions = (*w->screen->getAllowedActionsForWindow) (w);
> > WRAP (ps, w->screen, getAllowedActionsForWindow,
> > pluginGetAllowedActionsForWindow);
> >
> > return actions & pluginAllowedActions;
> > }
> >
> > and call recalcWindowActions whenever you want it updated.
> >
> > Any problems, just let me know.
> >
> > - David
>
> There is a little but a bit funny typing error - it is necessary to delete the tilde on line 696 of window.c, otherwise
> all common actions will be taken from all the windows.
Yes, I noticed this mistake too and it's now fixed.
- David
More information about the compiz
mailing list