cosmic-panel icon indicating copy to clipboard operation
cosmic-panel copied to clipboard

Panel with auto hide and gap between screen edge won't stay visible

Open InfinityGlitch opened this issue 1 year ago • 3 comments

https://github.com/user-attachments/assets/587693dd-bc7a-4f5b-980a-27ecff37e96b

If a panel is set to auto hide and to leave a gap between itself and the screen edge, then moving the cursor to the screen edge will cause the panel to appear and immediately disappear unless the cursor is moved up during the panel appearance animation.

InfinityGlitch avatar Sep 07 '24 12:09 InfinityGlitch

I came here to post the same thing. And it's not the same issue, but I think it makes sense to extend the button click area as well as the panel hover area to the screen edge, regardless of the gap size: https://github.com/pop-os/cosmic-panel/issues/233.

nathansgithub avatar Sep 10 '24 22:09 nathansgithub

This is the same issue as #149. It's likely not a panel issue but an issue with cosmic-comp, where there are 1 pixel lines along the bottom and right screen edges that block input. It works properly if a panel is on the top or left screen edges.

git-f0x avatar Sep 11 '24 22:09 git-f0x

I'm having a similar problem. With Dock settings autohide enabled and gap enabled; I move my mouse to the dock past 'the gap' (i.e. the very bottom of the screen), it pops up then auto-hides immediately.

One thing I found while messing around: Manually changing the value in ~/.config/cosmic/com.system76.Cosmic.Panel.Dock/v1/margin below 4 "hides" the problem.

And to make this more frustrating, sometimes, but not always, when I re-save Margin as 4 (the default), the problem won't comeback until I restart or log out of my current session.

fitzy1321 avatar Sep 12 '24 18:09 fitzy1321

Just a few observations around this issue as I add some debug info to cosmic-comp:

  1. When checking the extent of the mouse cursor position in cosmic-comp, it correctly outputs the f64 value as "one f64 lower" than the width of my screen. Example: my screen is 2256 pixels wide, but I am using 150% scaling, so 2256/1.5 is 1504. The value of the mouse cursor x position when I move it to the far right edge of the screen is 1503.999999999998, confirming that at least cosmic-comp is doing the correct thing here. I was unable to detect it clamping or otherwise changing the value to 1503.0 or 1502.0 or 32bit integers (which might account for right-edge and bottom-edge issues).
  2. My ~/.config/cosmic/com.system76.Cosmic.Panel.Dock/v1/margin config is set at 0, but the bug still happens for me as described in the original post.

canadaduane avatar Nov 05 '24 15:11 canadaduane

A little more progress to report: I've been tracing the Visibility::TransitionToVisible and Visibility::TransitionToHidden states in cosmic-panel to see how the left- and right-hand panels behave differently. I've narrowed it down to the wrapper_space's pointer_leave event firing incorrectly (several times, and not when the mouse cursor has left the region) on the right-hand panel.

As a result, the c_hovered_surface FocusStatus state changes to LastFocused(now), and this cascades to the result that this issue describes.

Edit: Traced it as far as https://github.com/pop-os/client-toolkit and the wayland_client::protocol::wl_data_device::Event::Leave event.

canadaduane avatar Nov 06 '24 04:11 canadaduane

Edit: Traced it as far as https://github.com/pop-os/client-toolkit and the wayland_client::protocol::wl_data_device::Event::Leave event.

Do you mean a pointer Leave event? If the panel receives a leave event, it starts the countdown to hide, and it really shouldn't be receiving a leave event if the mouse is on the surface. Assuming the panel has a zero margin on the edge that it is anchored to, and the input region is the correct size, it shouldn't be receiving any leave events from the compositor when the pointer is pushed to the edge of the screen.

wash2 avatar Nov 06 '24 16:11 wash2

https://github.com/pop-os/cosmic-panel/commit/d0d79726307405cdf2d879d3fb6162a8b2f5996a should fix this

wash2 avatar Nov 06 '24 19:11 wash2

Just wanted to come back and confirm that your patch fixes the issue, @wash2 . Thanks!

canadaduane avatar Nov 07 '24 04:11 canadaduane