[openbox] Adding finalactions to showmenu

richo richo at psych0tik.net
Mon Nov 14 16:37:01 EST 2011


On 14/11/11 11:03 -0500, Dana Jansens wrote:
>On Mon, Nov 14, 2011 at 7:13 AM, richo <richo at psych0tik.net> wrote:
>>
>> I added a new action to warp the cursor to the currently focused window (I
>> realise it should probably be centered on the visible space, I will do that
>> next), but unless I did something stupid, merely adding <action
>> name="Warp"/>
>> to the showmenu item didn't cause that action to happen after making a
>> selection from the menu.
>
>I think I get it.  You would need to attach those final actions to the
>menu(s) that open somehow.  But what if you do final actions on menu
>with programs to run in it?  You won't be able to warp to new windows
>this way.

This is what I realised halfway through writing my last post.

I guess I will make a proof of concept work with the client-list and
client-list-combined menus and then work out some sane behaviour for other
cases.

>
>I have a git branch for making hooks:
>http://git.openbox.org/?p=dana/openbox.git;a=shortlog;h=refs/heads/wip/hooks
>
>One possible way to do this would be to use a hook for "focused" and
>stick the warp action in there, as it gets all the cases.  But the
>hooks code is not on the main dev tree because it was really easy to
>make hooks that looped infinitely (e.g. when maximzed state changes,
>run ToggleMaximize).  I think the right way to address this is to just
>limit the amount of recursion an action can do.  This is something you
>could tackle if you're interested.
>

Thanks, I will rebase my work on top of this branch and then take a look at a
recursion limit.

>Otherwise I think it would need to be yet another "focus" option, to
>catch things like new windows.

I originally implemented this with a <mouseToFocus> option but it was kludgy
and not particularly configurable, in that I hasically hard to hardcode tests
for that config value in amongst the specific conditions I wanted to see it.

It also introduced a concerning number of edge case bugs, someone with more
skill may be able to see something stupid I've done, but I'm unconvinced that
it's the best way to do it.
--
richo || Today's excuse:

Communications satellite used by the military for star wars.
http://blog.psych0tik.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://icculus.org/pipermail/openbox/attachments/20111115/69d62210/attachment.pgp>


More information about the openbox mailing list