[openbox] Adding finalactions to showmenu

Dana Jansens dana at orodu.net
Sun Nov 13 11:29:40 EST 2011


On Fri, Nov 11, 2011 at 10:41 PM, richo <richo at psych0tik.net> wrote:
>
> Hi List,
>
> I'm in the process of trying to add a finalactions stanza to showmenu so that
> you can configure some actions to fire when the menu is complete.

I;m having trouble understanding why you would want/need this at all.
You can just add actions after the showmenu action.

> I am using cyclewindows as a reference implementation, but struggling to find
> documentation.
>
> If I declare setup_func as
>
> static gpointer setup_func(xmlnodeptr node,
>        obactionsiprefunc *pre,
>        obactionsiinputfunc *input,
>        obactionsicancelfunc *cancel,
>        obactionsipostfunc *post)

This is for parsing the action's options. All the ObActionsI*
functions are for interactive actions, which showmenu is not.

> I believe that I then point pre, input, cancel and post to functions to be
> executed in those conditions. My questions are:

You would only need to change the parsing inside the setup function to
read the final actions there and save them in the Options struct.

> Do I need to write a noop function to set the ones I'm not using to?
>
> And how safe is it to stuff the ObClient that I'm dealing with into the
> Options struct for later retrieval in my post function?

The ObClient comes from Openbox when the action is executed, and is
passed to the action's execute function.  Whereas, the Options struct
is created when the config file is read.

> Or alternately, am I approaching this entirely the wrong way?
>
> Thanks


More information about the openbox mailing list