jonaburg / picom

A lightweight compositor for X11 (previously a compton fork)
Other
956 stars 99 forks source link

Could it animate workspace switching? #31

Open xlucn opened 3 years ago

xlucn commented 3 years ago

I think this might be nitpicking, but just curious if picom could detect that I am switching workspace, and animate window entering/exiting according to the switching direction?

E.g. if I switch from workspace 1 to workspace 2, picom can move the windows on workspace1 to the left and show new windows on workspace 2 from right. And vice versa. Maybe leave the workspace layout (horizontal or vertical) configurable since that varies for different WMs.

r4bbit-r4 commented 3 years ago

I'd be willing to work in this if someone has resources to help me get started with hacking on picom, some kind of tutorial or documentation. I'd love to do it :)

jonaburg commented 3 years ago

I think this might be nitpicking, but just curious if picom could detect that I am switching workspace, and animate window entering/exiting according to the switching direction?

E.g. if I switch from workspace 1 to workspace 2, picom can move the windows on workspace1 to the left and show new windows on workspace 2 from right. And vice versa. Maybe leave the workspace layout (horizontal or vertical) configurable since that varies for different WMs.

It absolutely could! Fortunately thanks to the EWMH spec, we can use a property called _NET_CURRENT_DESKTOP which I assume works with most tiling window managers. Getting something vaguely expected working is actually fairly trivial, but it's extremely buggy at the moment and the animations have a hard time following through totally if there are some unmapped windows around. That said, I'm still looking for the cleanest implementation. This is however a feature high on my todo list, there's just unfortunately a seemingly never ending road to get there :D.

I'd be willing to work in this if someone has resources to help me get started with hacking on picom, some kind of tutorial or documentation. I'd love to do it :)

Feel free to try your own implementation of the above idea. You can play around with _NET_CURRENT_DESKTOP in your shell as well with xprop -root -notype _NET_CURRENT_DESKTOP to get an idea of the source of the switch logic which will determine the left or right animation. Take a look at event.c and picom.c, most of the code relating to animations will be there. Going through the XCB documentation would be super helpful here!

calmestwill commented 3 years ago

Any updates on this? Was just thinking today how great it would be if the workspace switching was animated in this sort of way. If you have anything I would be willing to test.

r4bbit-r4 commented 3 years ago

Sorry guys, I just got started at my new job. I will work on this but will probably take a long time :)

godalming123 commented 2 years ago

I would love to see this in the mainline branch!