Listening to ConfigureNotify has the effect that a lot of module updates are done when dragging and moving, or dragging and resizing a window, which allows to immediately sort the list by position, but is the biggest performance drawback of the entire program I think?
So let's add a config check, if sort_by is not "position", then we can omit SubStructureNotifyMask from this (if I recall correctly):
|
// Ask X server to send ConfigureNotify and PropertyNotify events for root window |
|
// ConfigureNotify is sent when a window's size or position changes |
|
// PropertyNotify for changes in client list and active window |
|
Window root = DefaultRootWindow(d); |
|
XSelectInput(d, root, SubstructureNotifyMask | PropertyChangeMask); |
Also see if solution in #6 causes a lot of events.
Thanks @Dupond:
I've carried out a few performance tests on my machine: in normal use, the impact of the module seems almost non-existent (at least, it's not very different from what it was with my previous script); but when moving a window, my 4 CPUs easily climb to 25 or 30% utilization each (tested with htop), whereas with my previous script, in this same scenario, they remained below 10%.
(from #25)
Listening to
ConfigureNotifyhas the effect that a lot of module updates are done when dragging and moving, or dragging and resizing a window, which allows to immediately sort the list by position, but is the biggest performance drawback of the entire program I think?So let's add a config check, if
sort_byis not"position", then we can omitSubStructureNotifyMaskfrom this (if I recall correctly):windowlist/main.c
Lines 413 to 417 in 27530c9
Also see if solution in #6 causes a lot of events.
Thanks @Dupond:
(from #25)