[compiz] replace notify functions with functions that apply changes

Erkin Bahceci erkinbah at gmail.com
Thu Mar 29 11:48:45 PDT 2007


I think it makes sense to allow code execution before and after the change.

Regards,
Erkin

On 3/29/07, David Reveman <davidr at novell.com> wrote:
> I've been thinking about removing all existing notification functions in
> favor of just having functions that apply changes. This is better as it
> allow each plugin to execute something both before and after the change
> has been applied. Example:
>
> Instead of wrapping a windowStateChangeNotify function you would wrap a
> changeWindowState function
>
> static void
> pluginChangeWindowState (CompWindow *w, int state)
> {
>     int oldState = w->state;
>
>     PLUGIN_SCREEN (w->screen);
>
>     if ((oldState ^ state) & STATE_PLUGIN_CARE_ABOUT_MASK)
>     {
>         /* do something interesting */
>     }
>
>     UNWRAP (ps, w->screen, changeWindowState);
>     (*w->screen->changeWindowState) (w, state);
>     WRAP (ps, w->screen, changeWindowState, pluginChangeWindowState);
>
>     if ((oldState ^ state) & STATE_PLUGIN_CARE_ABOUT_MASK)
>     {
>         /* do something else interesting */
>     }
> }
>
> This makes even more sense for move and resize notify functions and
> before we add another notify function I'd like us to decide if we want
> to do this or not. I'm strongly in favor of making this change.
>
> - David
>
> _______________________________________________
> compiz mailing list
> compiz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/compiz
>


More information about the compiz mailing list