swayfx icon indicating copy to clipboard operation
swayfx copied to clipboard

Keep cursor active when hidden

Open iguanajuice opened this issue 1 year ago • 4 comments

Resolves this issue: https://github.com/swaywm/sway/issues/6297 And kinda resolves this one, too: https://github.com/swaywm/sway/issues/7853

This was denied in vanilla sway because "Invisible-but-still-active cursors are confusing." (I don't see how).

This not only would fix gaming when using hide_cursor when-typing, but it will also let you hover for a preview and have it not "despawn" after the timeout.

For example: if you read a Wikipedia page, there are links to other articles that you can hover over to show a preview for; problem is, when using hide_cursor [timeout], the preview goes away when the cursor hides since the cursor also "deactivates". This is extremely annoying.

Here are some links to Reddit of people complaining about hide_cursor's current behavior: https://www.reddit.com/r/swaywm/comments/10kevqd/avoid_using_the_option_hide_cursor_whentyping_by https://www.reddit.com/r/swaywm/comments/n7m5d2/a_script_to_disable_hide_cursor_whentyping_when

I've been using this patch for a couple of days now and everything works fine. It's only a sloc change.

iguanajuice avatar Jan 10 '24 22:01 iguanajuice

I like this change, and I think it should be included in the project!

However, the functionality should be behind a config option. I also think the option should be inactive by default, to keep the notion of "drop in sway replacemnet".

Sntx626 avatar Jun 28 '24 14:06 Sntx626

I am running with this patch and it allows me to add hide cursor back in without having any of the negative side effects. I think upstream would take this if they were aware of what hide-cursor does.

  1. You can't use tool tips in Firefox (without constantly moving your mouse)
  2. Games like xontoic continuously recenter your screen when the mouse goes-away.

If this becomes stale I can do the work to make a option here, just let me know.

mbrumlow avatar Aug 02 '24 17:08 mbrumlow

I think upstream would take this if they were aware of what hide-cursor does.

Funny you say that; they are aware of what disabling the cursor when hiding does. Enough so that it's in Sway's manpages: https://github.com/swaywm/sway/pull/7435/commits/25fdb7ca1a8b8b7e69b09eb39ad44d6af9881162

iguanajuice avatar Aug 02 '24 20:08 iguanajuice

I've added a patch for disabling cursor deactivation upstream, but it's gone ignored so far: swaywm/sway/pull/8321

I'll consider opening a PR here, but I'd really hate to deviate from upstream.

iguanajuice avatar Sep 05 '24 15:09 iguanajuice