[compiz] [PATCH] Actions restrictions

David Reveman davidr at novell.com
Tue Mar 6 08:32:32 PST 2007


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



More information about the compiz mailing list