Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow for increasing the activation area in autohide mode #65

Closed
simonlearnscoding opened this issue Nov 18, 2024 · 14 comments

Comments

@simonlearnscoding
Copy link

in autohide mode only a very tiny portion on my desktop opens the panel, a lot of time I struggle finding that perfect sweet spot, please allow for a setting where I can increase the area that would activate it

@nwg-piotr
Copy link
Owner

This has been done some time ago, and now the hotspot area takes a half of the dock with, if I remember well. Do you know that the pointer speed is important? Slow mouse movement won't trigger the dock. Otherwise some part of the screen would be permanently unclickable.

@simonlearnscoding
Copy link
Author

@nwg-piotr could it be related to my styles perhaps? I have to put the cursor at the very center of the bottom of the screen, I have to aim well for the dock to appear


window {
  background: #191724;
  border-radius: 12px;
  border-style: solid;
  border-width: 2px;
  border-color: #6e6a86;
  opacity: 0.9;
}

#box {
  /* Define attributes of the box surrounding icons here */
  padding: 4px;
}

#active {
  /* This is to underline the button representing the currently active window */
  border-bottom: solid 1px;
  border-color: #eb6f92;
}

button,
image {
  background: none;
  border-style: none;
  box-shadow: none;
  color: #999;
}

button {
  padding: 4px;
  /* margin-left: 4px; */
  /* margin-right: 4px; */
  color: #eee;
  font-size: 12px;
}

button:hover {
  background-color: #26233a;
  border-radius: 12px;
}

button:focus {
  box-shadow: none;
}
``

@nwg-piotr
Copy link
Owner

nwg-piotr commented Nov 20, 2024

The hotspot css is embedded in the code. However, its dimensions are not defined here, but with hotspotBox.SetSizeRequest().

		mRefProvider, _ := gtk.CssProviderNew()
		css := "window { background-color: rgba (0, 0, 0, 0); border: none}"
		err := mRefProvider.LoadFromData(css)

I painted the hotspot red for it to be visible. It's really quite large and easy to find, I think.

obraz

obraz

@simonlearnscoding
Copy link
Author

@nwg-piotr then It looks like I might have a bug in my config because for me the activation spot is just a tiny spot in the bottom center of the screen

@arminius-smh
Copy link
Contributor

Maybe not quite related to this, but I think an option for the activation are would be nice, since I use nwg-dock-hyprland with -mb 5 and -d and it's basically impossible for me to open the dock, since the activation area moves up with the margin. So if I move my mouse too quick to the bottom of my screen, it will skip the activation area and my mouse remains at the bottom of the screen without opening the dock

with -hd 0 it's possible to open it if I move my mouse slowly to the bottom of the screen until I am in the activation area, however ideally I'd like to keep the activation area at the bottom so I can just "slam" my mouse to the bottom of the screen and the dock opens

@oluijks
Copy link

oluijks commented Dec 31, 2024

I have the same issue, when applying a bottom margin it's nearly impossible to hit the hotspot.

@nwg-piotr Would it be possible to have the possibility to adjust the css in the user config so we could take the margin into account?

@nwg-piotr
Copy link
Owner

Would it be possible to have the possibility to adjust the css in the user config so we could take the margin into account?

I don't think it's going to help, but here you go.

@nwg-piotr
Copy link
Owner

Use e.g.

window {
  background-color: rgba (0, 0, 0, 0);
  border: solid 1px
}

to see the hotspot.

@arminius-smh
Copy link
Contributor

hotspot.mp4

Thanks for the option to set the hotspot css - but is the hotspot working as intended? I think the video shows why it is probably so difficult to try and hit the hotspot, as well as why I am constantly skipping over it with a bottom margin, since for me the actual hotspot activation area seems to only consist of a one pixel line at the bottom of the box, where as I assume it should be the whole area in red?

@oluijks
Copy link

oluijks commented Jan 3, 2025

Thank you @nwg-piotr I experience and see the hotspot the same as @arminius-smh, the hotspot seem to behave differently when there is no bottom margin. it is a combination of mouse speed and exactly hitting the right spot that only opens the dock in my case... again, not a huge issue rather a annoynace

@nwg-piotr
Copy link
Owner

nwg-piotr commented Jan 3, 2025

We measure the time between detectorEnteredAt (blue area, 1/3 dock height), and hotspotEnteredAt (red area, 2px height), see here.

obraz

Your problem is the margin, that does not go well with the autohiDe mode: the pointer leaves the hotspot area.

obraz

The only solution I see is to keep the hotspot at the very edge of the screen, by omitting margins (for the hotspot, not all the dock).

@nwg-piotr
Copy link
Owner

Done in the commit above.

@arminius-smh
Copy link
Contributor

We measure the time between detectorEnteredAt (blue area, 1/3 dock height), and hotspotEnteredAt (red area, 2px height), see here.

Ah I see, thanks for explaining it, I wasn't aware that there are actually two boxes to determine when to open the dock

The only solution I see is to keep the hotspot at the very edge of the screen, by omitting margins (for the hotspot, not all the dock).

Yes, thanks that solution works perfectly for me now and the dock behaves as expected and nicely with a margin!

@nwg-piotr
Copy link
Owner

Thanks for confirmation!

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

No branches or pull requests

4 participants