lxqt-panel
lxqt-panel copied to clipboard
Autohide animation does not work on wayland
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
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.
Right :)
Btw dropdown terminal has the same issue, I remember it had an animation under X11.
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 @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.
This isn't a priority, IMHO, although it should have been reported.
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.
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.
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.
As I mentioned above, there are much more important and practical issues. The lack of animation isn't a real issue.
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.
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.
I'm enjoying it with animation on kwin_wayland now :) It's exactly like LXQt+kwin_x11.