bar icon indicating copy to clipboard operation
bar copied to clipboard

Cursor Hover support

Open nims11 opened this issue 9 years ago • 4 comments

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. :)

nims11 avatar Nov 09 '16 17:11 nims11

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.

krypt-n avatar Nov 09 '16 18:11 krypt-n

True. Repeated outputs is not a clean way to handle hovers. I will implement mouseenter/mouseleave and update here.

nims11 avatar Nov 09 '16 20:11 nims11

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.

nims11 avatar Nov 10 '16 09:11 nims11

You're right, didn't think about that. Maybe compare the begin, end and command of the currently hovered area?

krypt-n avatar Nov 10 '16 09:11 krypt-n