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

Autohide animation does not work on wayland

Open stefonarch opened this issue 1 year ago • 5 comments

Stumbled upon this by reading https://github.com/labwc/labwc/issues/2129

Expected Behavior

There is an animation

Current Behavior

Panel appears and disappears

Possible Solution

Probably hard. Greying out the option if on wayland?

  • LXQt Version: 2.0, git

stefonarch avatar Sep 08 '24 08:09 stefonarch

Greying out the option if on wayland?

If we continue to do that with options that don't work on Wayland, we might lose track and forget to enable them when a solution is made possible.

tsujan avatar Sep 08 '24 10:09 tsujan

Right :)

Btw dropdown terminal has the same issue, I remember it had an animation under X11.

stefonarch avatar Sep 08 '24 10:09 stefonarch

Btw dropdown terminal has the same issue,

No, it doesn't have animation. Some WMs (like KWin) can animate windows under specific circumstances. For example, I'd added a nice slide-in/out animation to LXQt notifications under LXQt+kwin_x11.

tsujan avatar Sep 08 '24 11:09 tsujan

@tsujan @stefonarch Since it's a layer-shell-surface, normal animations may not work. What you need to animate (at least in the panel) is the layer-surface's margin. Of course, we can play with the height as well.

marcusbritanicus avatar Sep 09 '24 04:09 marcusbritanicus

This isn't a priority, IMHO, although it should have been reported.

tsujan avatar Sep 09 '24 09:09 tsujan

Animation aside, auto-hiding on overlapping doesn't work fine under kwin_wayland, which is the only place where it should work. I found and fixed all of its issues, such that now it works with kwin_wayland as it does with X11 (except for animation, of course). Will make a PR soon.

tsujan avatar Nov 05 '24 22:11 tsujan

Isn't animation easy to do? Atleast if we are operating with the a few assumptions...

By default, we set the margins to (l: 0, t: 0, r:0, b:0). For animations (top panel), while showing the panel set the margins to (l: 0, t: -panelHeight, r: 0, b: 0) at the beginning, and then use QVariantAnimation to change it as you want. The reverse of this process will be the hiding part.

Of course, this becomes complicated when there are two or more panels for a given edge - but let's not discuss that at the moment.

marcusbritanicus avatar Nov 06 '24 06:11 marcusbritanicus

Animation aside, auto-hiding on overlapping doesn't work fine under kwin_wayland, which is the only place where it should work.

I have added auto-hide support for DesQ Panel, and it works quite well. I do not see why it's a problem. It requires support from the compositor side, of course, for perfect auto-hiding.

On wayfire and kwin, we have support for "hot-spots" which can trigger the "show" of the panel. On other compositors, when autohiding, keep 1px or 2px of the panel visible. If the mouse enters that area, show the panel. When the mouse leaves the panel, hide it. Adjust the exclusion zone as necessary. One suggestion though: Do not change the exclusion zone each time the margin changes - changing the exclusion zone is a costly affair.

marcusbritanicus avatar Nov 06 '24 07:11 marcusbritanicus

As I mentioned above, there are much more important and practical issues. The lack of animation isn't a real issue.

tsujan avatar Nov 06 '24 10:11 tsujan

To my own surprise, I made the animation work too, simply by adding appropriate negative margins to the layer and using QVariantAnimation. At least under kwin_wayland, it works fine. I'll add it to my upcoming PR.

tsujan avatar Nov 06 '24 12:11 tsujan

IMO autohiding is used and liked by many people, so it would be nice if we can provide it. Personally I don't like ti though.

stefonarch avatar Nov 06 '24 12:11 stefonarch

I'm enjoying it with animation on kwin_wayland now :) It's exactly like LXQt+kwin_x11.

tsujan avatar Nov 06 '24 13:11 tsujan