[compiz] [PATCH] Actions restrictions
Vasek Potocek
vasek.potocek at post.cz
Tue Mar 6 15:56:09 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
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.
Vasek
More information about the compiz
mailing list