Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Cursor Hover support #30

Open
wants to merge 2 commits into
base: xft-port
Choose a base branch
from
Open

Cursor Hover support #30

wants to merge 2 commits into from

Conversation

nims11
Copy link

@nims11 nims11 commented Nov 9, 2016

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

@krypt-n
Copy link
Owner

krypt-n commented Nov 9, 2016

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.

@nims11
Copy link
Author

nims11 commented Nov 9, 2016

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

@nims11
Copy link
Author

nims11 commented Nov 10, 2016

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.

@krypt-n
Copy link
Owner

krypt-n commented Nov 10, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants