Wayland Wobbly Whistles

I found some time and inspiration to resume working toward wobbly wayland surfaces. After making decent progress, it’s time for another blog entry.

Effects such as wobbly windows are argued by some to be a blatant waste of time for both developers and users. However, many still enjoy wobbling their windows despite the controversy. Some power users claim that the mindless wobbling is a welcome brain rest during other tasks. Critics aside, the effect continues to live on in different forms and implementations.

In this iteration, I decided to port the original compiz plugin to wayland surfaces. First, I isolated the code to identify the algorithm inputs and bound the output to a more easily portable format. Then I worked on massaging it into the compositor code, creating a rudimentary plugin API. In the process, the zoom code was also isolated in it’s own plugin. For the moment, plugins aren’t loaded automatically and must be specified in the config file.

Surprisingly, the model positioning code is the most complicated issue because the plugin must render such that the surface position is synced with the compositor when the wobbling cycles are complete. One annoying positioning problem was related to a combination of rotating and resizing but I managed to track down the core issue and fix this case.

The way opaque and blend regions are handled requires duplicate rendering; one with the opaque rbgx shader and another pass for blended rgba. Since wobbly requires additional arbitrary vertices, it’s not really feasible to draw two different regions. For now, it uses the usual rgba shader if the blend region is not empty and the rgbx shader otherwise.

Further plans include writing an interface to talk to the compositor from a GUI and more compiz-like plugins. Check back later for more updates.