From: Arnout E. <no...@bz...> - 2011-11-06 14:02:04
|
(moved to '-devel' as this is about changing/extending the way notion works) On Fri, Oct 21, 2011 at 11:34:28AM +0100, David Given wrote: > Possibly rather than try to change the defwinprop behaviour, it would be > better to do this via new behaviour? Maybe something as simple as: > > add_winprop_hook( > function(prop, cwin, id) > -- make all windows float unless specified otherwise > if not prop.float then > prop.float = true > end > end > ) > > These then get run (in order) after ioncore.getwinprop() has scanned the > defwinprop list. This should satisfy Principle of Least Surprise while > at the same time being more flexible. Even better might be to use the existing 'hook' infrastructure: when a client window is created, you could then set it to 'float' in a hook that runs after creation and before the winprops are applied. Some winprops are applied directly in clientwin_get_winprops, others are just placed into cwin->proptab for later evaluation. This would mean: * adding a hook that fires when initializing a client window, before winprops are applied * change 'cwin->proptab=tab' to merge the new values into a possibly- preexisting proptab instead of overwriting it. * make 'proptab' available via lua Then the client code could look something like: ioncore.get_hook('clientwin_init_hook'):add( function(cwin) cwin.proptab = { float = true } end ) Does that make sense? How does it compare to the other proposed solution? Kind regards, Arnout |