bar
bar copied to clipboard
Cursor Hover support
In addition to various mouse clicks, now one can make lemonbar generate output based on hovering over an area ( %{A0} ) (demo: https://gfycat.com/EvenObviousAmazontreeboa). Currently it makes lemonbar generates output for every hover movement and more complex scenarios can be implemented if required (such as mouseleave / mouseenter events).
I find this feature useful and was hoping not having to maintain a separate fork just for this small feature. :)
Output for every movement seems like quite a lot of output to me.
I'd suggest implementing mouseenter/mouseleave outputs for areas (could be defined via additional A numbers) and outputting them whenever area != oldarea on a xcb_motion_notify.
Would you want to implement that?
In the ideal scenario, the changes would be made in lemonboy's repo, but the development there has been slow the last few months.
True. Repeated outputs is not a clean way to handle hovers. I will implement mouseenter/mouseleave and update here.
An issue with implementing mouseenter/mouseleave is that it requires to save some form of state across time (like the currently hovered area) which is a hassle since areas are recreated very often and pointers get invalid (thus, a simple reference to an area won't work).
Do you have any suggestions? Meanwhile I will test out couple of ideas I have on handling this issue.
You're right, didn't think about that. Maybe compare the begin, end and command of the currently hovered area?