[openbox] events & actions
Ava Arachne Jarvis
ajar at katanalynx.dyndns.org
Mon Nov 4 02:06:46 EST 2002
[Marius Nita - Sun, 3 Nov 2002 11:47:41 PM CST]
> so what are actions? i have only vague thoughts about this so far, but an
> action is associated with something which happens in the wm at the user level.
> for example, shading a window is an action. so is moving one, closing one,
> opening a menu, highlighting the next item in a menu, etc. this works much
> like epist's actions.
Also like Waimea's actions, which also cover mouse actions (dragging,
clicking, etc). Look at their manual page, at
http://axtorpsv044.sn.umu.se/cgi-bin/man/man2html?waimea
under "ACTIONS".
> i think this will rock. OBXEvent will hold the XEvent pointer, OBSignalEvent
> will hold the signal to handle, and OBActionEvent will hold a pointer to the
> Action object, which holds enough information about what needs to be done. in
> the ob event loop, it will be a matter of telling the right object to handle
> the event. I'm still not sure about how to exactly identify which handler func
> is called.
Sounds like a table is called for? Each event type has only one
handler, or possibly a list of handlers.
> now, these actions are cool things. why? because it opens the door to an
> action-based highly configurable system--we discussed this a while back. the
> user will be potentially able to say
>
> # move window with alt-left click
> action {
> binding Mod1-LeftClick
> location all
> action startMove
> }
>
> # resize window with alt-right click
> action {
> binding RightClick
> location rightGrip
> action startResize
> }
>
> well not quite but you get the idea. none of the ob behavior will be
> hardcoded; it will come with a default action file. pwm does this to an
> extent, maybe we can learn tons by looking at that.
Also Waimea. Waimea also lets you define macros:
DEF definedTitleActions {
StartMove : ButtonPress = Button1,
EndMoveResize : ButtonRelease = Button1
}
window.title {
definedTitleActions,
ToggleShade : DoubleClick = Button1
}
> oh, also, one more reason that actions are cool is because they are one
> codepath for everything. the ONLY time ob will resize a client window is when
> it executes a startResize action. So somehow, a lot of x events will have to
> be dealt with via actions. (And maybe even some signals, like -USR1 will
> execute a Reconfigure action or something.)
HUP already does that, I thought. I'm not sure how many other things
people can do with signals, exactly, that would be useful in a window
manager...
> so one codepath for all wm<->user things, and one codepath for all event
> handling. really cool stuff, i think.
--
| His designs were strictly honourable, as the phrase is: that is,
| to rob a lady of her fortune by way of marriage.
| -- Henry Fielding, "Tom Jones"
More information about the openbox
mailing list