perf: don't rerender on configure, if w/h didn't change

This commit is contained in:
Raphael Robatsch 2021-11-04 08:32:02 +01:00
parent b5c9de5619
commit a6104020cb

View file

@ -158,6 +158,8 @@ void Bar::click(Monitor* mon, int x, int, int btn)
void Bar::layerSurfaceConfigure(uint32_t serial, uint32_t width, uint32_t height) void Bar::layerSurfaceConfigure(uint32_t serial, uint32_t width, uint32_t height)
{ {
zwlr_layer_surface_v1_ack_configure(_layerSurface.get(), serial); zwlr_layer_surface_v1_ack_configure(_layerSurface.get(), serial);
if (width == _bufs->width && height == _bufs->height)
return;
_bufs.emplace(width, height, WL_SHM_FORMAT_XRGB8888); _bufs.emplace(width, height, WL_SHM_FORMAT_XRGB8888);
render(); render();
} }