nwg-piotr / nwg-drawer

Application drawer for wlroots-based Wayland compositors
MIT License
240 stars 25 forks source link

Fix high CPU load #53

Closed Raffy23 closed 2 years ago

Raffy23 commented 2 years ago

This PR fixes #50 by using a channel instead of a boolean flag that is polled in a fixed interval. Currently all updates done by the file watcher will only be applied before displaying the window, which wasn't the case before, but I think it is still sufficient for the current usecase.

Raffy23 commented 2 years ago

I wasn't aware of this feature and it seems like a regression that can be fixed by handling the pinnedTrigger in a similar way as it is the case with the signals. With this patch the window needs to be closed and reopened for the changes to appear. Maybe it would also be a good idea to handle the pinned items differently without destroying & recreating the container for the buttons, but I think that should be part of a different issue / PR.

nwg-piotr commented 2 years ago

Maybe it would also be a good idea to handle the pinned items differently without destroying & recreating the container for the buttons

Setting a filter function would be the natural way, but it's not implemented in gotk3. In this use case it has little to none effect on overall performance, so I don't care.