mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-12-16 18:03:19 +00:00
Layer shell: Prevent infinte configure/commit loop
Check the wlr_layer_surface_v1_state.committed bitmask to see if we need to rearrange. This is also what sway does. Without this check, every commit request (even if only the attached buffer changed) will lead to another configure event, which will lead to another commit, etc. This loop results in swaybg consuming 100% CPU.
This commit is contained in:
parent
2d9740c2fc
commit
9b406d8d33
7
dwl.c
7
dwl.c
@ -150,6 +150,7 @@ typedef struct {
|
||||
|
||||
struct wlr_box geo;
|
||||
enum zwlr_layer_shell_v1_layer layer;
|
||||
bool mapped;
|
||||
} LayerSurface;
|
||||
|
||||
typedef struct {
|
||||
@ -755,6 +756,12 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
|
||||
struct wlr_output *wlr_output = wlr_layer_surface->output;
|
||||
Monitor *m;
|
||||
|
||||
if (wlr_layer_surface->current.committed == 0 &&
|
||||
layersurface->mapped == wlr_layer_surface->mapped)
|
||||
return;
|
||||
|
||||
layersurface->mapped = wlr_layer_surface->mapped;
|
||||
|
||||
if (!wlr_output)
|
||||
return;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user