Skip to content

Conversation

skewb1k
Copy link
Contributor

@skewb1k skewb1k commented Aug 25, 2025

When the mouse cursor was hidden with hide_when_typing enabled, hints could still be highlighted under the hidden cursor. This typically occurred when a hint moved underneath the stationary, hidden cursor.

This fix ensures hints are not highlighted by the mouse cursor while it's hidden.

Copy link
Member

@chrisduerr chrisduerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is undesirable? The mouse cursor still exists after all.

I personally have mouse cursor hiding enabled on the WM level and I still want highlighting to work under my mouse because that way I both know where my mouse is and I can just click without having to move my mouse first.

@skewb1k
Copy link
Contributor Author

skewb1k commented Aug 25, 2025

I'm not sure this is undesirable? The mouse cursor still exists after all.

I personally have mouse cursor hiding enabled on the WM level and I still want highlighting to work under my mouse because that way I both know where my mouse is and I can just click without having to move my mouse first.

I think I don't understand your point. How do you know where the mouse is if it's hidden, even at the WM level? Also, how do you use Alacritty's cursor hiding in this setup - do you actually need it as well?

@skewb1k
Copy link
Contributor Author

skewb1k commented Aug 25, 2025

Or do you "know" where the mouse is only because of the highlight effect? I can see why this could be a problem if you're used to that behavior, but doesn't it also create a lot of false positives that are distracting? I doubt anyone would rely on the cursor position still matching the hint after content has moved - they would probably just move the mouse instead.

I can make it optional to keep everyone happy, if you prefer.

@chrisduerr
Copy link
Member

Also, how do you use Alacritty's cursor hiding in this setup - do you actually need it as well?

I don't need it, I'm just arguing that if I don't want it with a setup that constantly hides my mouse, I don't see why people would want it with setups that occasionally hide the mouse.

I think I don't understand your point. How do you know where the mouse is if it's hidden, even at the WM level?

There are operations during which I don't move my mouse for a very long time, maybe I type a bit in between but the 'interaction location' is constant. In that scenario I don't feel like my mouse is 'gone', it's just out of the way temporarily.

but doesn't it also create a lot of false positives that are distracting?

Well if I don't want my mouse on top of the terminal I can always just move it away.

I can make it optional to keep everyone happy, if you prefer.

Who's unhappy right now though? Is this an issue you've personally struggled with? I've never heard anyone else complain and something so minor certainly isn't going to get a dedicated configuration option.

@skewb1k
Copy link
Contributor Author

skewb1k commented Aug 25, 2025

I don't need it, I'm just arguing that if I don't want it with a setup that constantly hides my mouse, I don't see why people would want it with setups that occasionally hide the mouse.

Because, if I understand correctly, when the mouse is “constantly” hidden, highlighting may be the only way to locate it. I still don't fully understand how usable that is, or why it requires enabling Alacritty's hiding.

In the case of hide_when_typing, the user can hover over a link and then continue typing. What I find distracting - and perhaps should be addressed as well - is that even when both the mouse and the hint aren't moving, the highlight is still unstable due to other events. For example, pressing Enter removes the highlight, and pressing Ctrl restores it, causing a sort of flashing effect.

There are operations during which I don't move my mouse for a very long time, maybe I type a bit in between but the 'interaction location' is constant. In that scenario I don't feel like my mouse is 'gone', it's just out of the way temporarily.

The current fix still allows you to open a hint without moving the mouse, although in practice the mouse usually moves anyway, so it doesn’t really matter.

Well if I don't want my mouse on top of the terminal I can always just move it away.

When the mouse is hidden, it seems logical that it shouldn't be still "visible" indirectly through other highlights. Why would I move objects that are effectively gone?

Who's unhappy right now though? Is this an issue you've personally struggled with? I've never heard anyone else complain and something so minor certainly isn't going to get a dedicated configuration option.

I guess most users rarely notice this behavior and aren't distracted by it, but they also don't rely on it for the same reasons.

@chrisduerr
Copy link
Member

I guess most users rarely notice this behavior and aren't distracted by it, but they also don't rely on it for the same reasons.

So why bother with additional complexity to change it?

@kchibisov
Copy link
Member

I'd argue that if mouse cursor is left, we shouldn't show it, for example, if you unplug your mouse completely, that will just won't make much sense if you occasionally will get something highlighted.

Like I notice it from time to time, but even though it never bothered me to actually fix it myself, I would prefer to not highlight hints, etc, if you we got an event telling us that our Mouse is left.

@chrisduerr
Copy link
Member

chrisduerr commented Aug 26, 2025

I'd argue that if mouse cursor is left, we shouldn't show it, for example, if you unplug your mouse completely, that will just won't make much sense if you occasionally will get something highlighted.

No mouse is different from an invisible mouse though.

Like I notice it from time to time, but even though it never bothered me to actually fix it myself, I would prefer to not highlight hints, etc, if you we got an event telling us that our Mouse is left.

This is different, no? If the mouse is not inside the window, I don't think we highlight today?

@kchibisov
Copy link
Member

kchibisov commented Aug 27, 2025

No mouse is different from an invisible mouse though.

Visually yes.

If the mouse is not inside the window, I don't think we highlight today?

it left from within the window boundary, like on Wayland, when compositor hides the cursor, you get the left event, but given that it happens within window boundaries we still highlight. Window refocus doesn't affect that, since we reset things, but not PointerLeft thing.

@chrisduerr
Copy link
Member

I think I'm just going to merge this after the 0.16.0 bump, so we have a full release cycle to see if anyone complains and if nobody does it's probably fine.

When the mouse cursor was hidden with `hide_when_typing` enabled,
hints could still be highlighted under the hidden cursor.
This typically occurred when a hint moved underneath
the stationary, hidden cursor.

This fix ensures hints are not highlighted by the mouse cursor while it's hidden.
@skewb1k skewb1k force-pushed the fix/hidden-mouse-hints branch from 11513e1 to 7457c29 Compare September 1, 2025 13:25
@chrisduerr chrisduerr merged commit 97fde10 into alacritty:master Sep 1, 2025
5 checks passed
@skewb1k skewb1k deleted the fix/hidden-mouse-hints branch September 1, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants