nwg-piotr / nwg-dock

GTK3-based dock for sway
MIT License
170 stars 9 forks source link

[Feature request] Take cursor acceleration into account when revealing hidden dock #30

Closed zoro11031 closed 1 year ago

zoro11031 commented 1 year ago

Suggestion: When the dock is in autohide mode, do not unhide the dock unless the mouse reaches a certain threshold of downwards velocity when it is moving to the dock's trigger area.

Benefit: This will prevent users from accidentally revealing the dock and obscuring the bottom of windows they may be trying to work with during regular use.

Not sure if this is feasible/possible to implement in this project, but just a suggestion because it works really well in GNOME's dock to shell extension's implementation of it.

nwg-piotr commented 1 year ago

No idea on how to measure the pointer speed here, as I just use the enter-notify-event. I could only think about adding some delay, and not showing the window if the pointer leaves the hotspot area before the delay ends.

nwg-piotr commented 1 year ago

After some further consideration (during boring shopping), I think I could, to some degree, measure the speed the hotspot was entered with. I need to install GNOME and see what you're talking about, in order not to implement the feature I haven't even seen.

zoro11031 commented 1 year ago

My roommate has GNOME on his setup, I’ll ask him if I can screen record the dock behavior if you’re interested. A slight delay would also work well!

zoro11031 commented 1 year ago

Here’s a video of the behavior, sorry about the poor quality, OBS on GNOME wasn’t cooperating with Pipewire and I didn’t want to spend too much time troubleshooting a DE I don’t use: https://youtube.com/shorts/vUA6-XJ8OfY?feature=share

nwg-piotr commented 1 year ago

I imagined it something like this. Will try to reproduce this behaviour, but I'm not sure if what I'm thinking about is going to work well. It'll turn out soon.

nwg-piotr commented 1 year ago

So, it could be implemented this way: https://youtu.be/DAP22C-aGF0

What do you think?

zoro11031 commented 1 year ago

That is exactly what I had in mind! 👍

nwg-piotr commented 1 year ago

It needs some more work, but should be ready soon.

zoro11031 commented 1 year ago

That’s awesome man, thank you so much for the great work!

nwg-piotr commented 1 year ago

I'm not 100% happy about it, but it works. You may check the add30 branch.

zoro11031 commented 1 year ago

I'm having trouble building it, but that's probably an issue with me not the project, I very rarely build things from source straight from github so I'm probably doing something wrong. When I run make build after running make get I get the following errors: ./tools.go:69:12: cannot use window.Change (variable of type sway.WindowEventChange) as type string in struct literal ./tools.go:87:33: cannot use eventHandler (variable of type swayEventHandler) as type sway.EventHandler in argument to sway.Subscribe: swayEventHandler does not implement sway.EventHandler (missing BarStateUpdate method) ./tools.go:117:33: cannot use eventHandler (variable of type swayEventHandler) as type sway.EventHandler in argument to sway.Subscribe: swayEventHandler does not implement sway.EventHandler (missing BarStateUpdate method) make: *** [Makefile:11: build] Error 2

Seems like some kind of mismatch with my sway version, maybe?

nwg-piotr commented 1 year ago

No idea. Are you on Arch Linux? Do you use nwg-shell or just the dock? One way or another, it must wait till tomorrow, as it's almost 4 am in my place.

zoro11031 commented 1 year ago

I'm on Arch and have the whole nwg-shell installed, but not using nwg-panel. No worries man!

zoro11031 commented 1 year ago

Awesome! THank you so much for the quick work

On Mon, Nov 14, 2022 at 6:44 PM Piotr Miller @.***> wrote:

Closed #30 https://github.com/nwg-piotr/nwg-dock/issues/30 as completed via #31 https://github.com/nwg-piotr/nwg-dock/pull/31.

— Reply to this email directly, view it on GitHub https://github.com/nwg-piotr/nwg-dock/issues/30#event-7809355564, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTWYSPF5644PLHTJF5CBHDWILMIXANCNFSM6AAAAAAR6G3QDM . You are receiving this because you authored the thread.Message ID: @.***>

nwg-piotr commented 1 year ago

You're welcome. Thanks in advance for further feedback. :)

zoro11031 commented 1 year ago

I just wanted to drop back and say that it works great! Thank you again man! This really improved the usability of the dock for me

nwg-piotr commented 1 year ago

I'm glad you like it. I'm just adding corresponding settings to nwg-shell-config:

image