Category Archives: Wayfire

Wayfire Carpet Burn

I figured Wayfire couldn’t have enough animations, so I wrote two more: Magic Carpet and Burn. The first interesting animation in Wayfire was affectionately named ‘fire’. It is resource intensive and isn’t very realistic looking, but it does resemble the original compiz fire effect quite well. However I wanted something a bit better, and wanted to try my hand at writing a GLSL shader that could fit the bill. After reading some about how to create flame effects with a random noise generating algorithm, I stumbled onto a shadertoy that looked like it might suit the occasion. Here is the original shadertoy from which ‘burn’ was adapted. It has 5 flames with varying degrees of detail. At first I installed the code and got it rendering something, but it wasn’t that great. Eventually I whipped it into shape, and now it burns windows nicely, as can be seen in the video below. It burns a little beyond the sides of windows, has configurable flame speed, width, height and smoothness and, after a suggestion in IRC from a user that saw it, configurable flame color. Go WayFIRE!

Since this was apparently not enough, Andrew Pliatsikas, a colleague and fellow Wayfire hacker, had been actively working on a roll-up style animation and called it the magic carpet effect. He offered me the code to improve upon, and while it did work, I decided not to use it because it used a mesh with many vertices, and I wanted to use a fragment shader with four vertices rather than a mesh, so there would be a finer granularity and more performance. So, with the idea in mind, I begin hacking together a mind bending, magic carpet rolling GLSL shader using trigonometric mathematics that faked everything from perspective projection to lighting. It uses a progress uniform as input for the animation which means the same animation happens predictably when opening or closing a window and, there are various easings that can be applied using Wayfire’s animation configuration infrastructure. There were some problem cases I ran into such as clamp-to-edge repeating edge pixels that are not fully transparent when sampling the texture using coordinates outside of the 0.0 – 1.0 floating point range, and lining up the front part of the roll with the back part, but I managed to wrangle these into submission just so, and now the effect is largely seamless and complete. After I got it rolling from left to right, I decided to make it configurable so that it can roll any cardinal direction. Additionally, Andrew has worked to make the roll effect into a scroll effect, unrolling the window from the center as a real scroll, using two rolls. The last video in this post shows the results. Check out the videos below to see the animations in action!

Wayfire Live Window Previews

2005 was the year of Compiz. 20 years later, we’re doing it all over again. Designed with the power user in mind, Wayfire continues to push the bar with astounding animations, effects and functionality. In today’s post, we’re talking about live window previews. The concept is that you have a window button in a taskbar and hovering over it yields a tooltip containing a live preview of the corresponding window. This is a sought after feature but there are many ways to skin this cat and wayland makes for an interesting ride. You can have the client tell the compositor where to render the tooltip preview but where’s the fun in that? You could have the client request a buffer stream and send the bits to the client so it can render them as it sees fit. So how did we do it? The latter seemed to be the more reasonable choice, so that’s how it started. Wayfire has the ability (for a plugin) to communicate with a client using ipc, side banding messages not on the wayland socket wire. The way this works is: On button enter, the client sends an ipc message with the view id. The wf-live-previews plugin receives this message and creates a view-sized headless output named “live-preview-#” where “#” is the view id. Then the plugin sets up rendering the view to the output. The client gets the new wl_output global and checks the name, then uses this to begin requesting frames for the hidden output using the standard wlr_screencopy protocol. Finally, it gets the frames and displays them (in this case) in a tooltip. And if that wasn’t enough, the client in question is a python panel called panorama-panel. It uses pywayland, pywayfire ipc and gtk4 in a python client, which make for a powerful combination. Now to drive the point home, is a video: