emersion / mako

A lightweight Wayland notification daemon
https://wayland.emersion.fr/mako
MIT License
2.18k stars 139 forks source link

use last_scale initially to avoid many redraws (which cause flickering) #460

Closed lilydjwg closed 1 year ago

lilydjwg commented 1 year ago

The problem

mako appears with scale=1, and finds the output prefers scale=2, so it redraws with scale=2. This makes the window reshapes (supposingly because pango redraws with higher dpi and the rounding is different). So every time it appears, it flickers once.

Proposed solution

Remember last scale because it's very likely that the next time a notification is shown it's on the same output, thus avoiding above flickering in this case.

emersion commented 1 year ago

The real solution is adding support for the new wl_surface.preferred_buffer_scale event. I'd rather not add fragile heuristics.

lilydjwg commented 1 year ago

OK, I'll wait for it to settle.