Draft
Conversation
somiaj
reviewed
Dec 20, 2025
Comment on lines
-945
to
+951
| SendText(fd, "Send_WindowList", 0); | ||
| char *scr_name = mon->si->name; | ||
| char msg[4096]; | ||
|
|
||
| if (is_global) | ||
| scr_name = ""; | ||
| snprintf(msg, sizeof(msg), "Send_WindowList %s", scr_name); | ||
| SendText(fd, msg, 0); |
Collaborator
There was a problem hiding this comment.
Why not just use
char msg[4096];
if (is_global)
msg = "Send_WindowList"
else
msg = snprintf(msg, sizeof(msg), "Send_WindowList %s", mon->si->name);
Keeps the msg from having an extra space, "Send_WindowList ", in the global case, though probably doesn't matter, just a thought I had.
When modules send a request for all windows, this can be computationally expensive as this was sent for all monitors. It was expected that modules would filter these packets out. However, this operation is expensive the more monitors which are attached with windows. Allow for modules to opt-in to immediately filtering out a specific monitor at source, by appending the name of a monitor to the end of the "Send_WindowList" command.
When requesting a list of windows to operate on, explicitly send the monitor name to use. This is only applicable if -screen is set or none is provided (defaulting to the current monitor). This is ignored in the case where the global screen has been requested.
752b441 to
a370c8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tries to improve the performance of the internal
Send_WindowListcommand by allowing a filter at source, to explicitly denote which monitor
should be used. This is useful for certain modules; currently
FvwmRearrangeis using this, but
FvwmPagermight benefit from it in the future.The more connected (and active) monitors there are, the slower this operation
becomes -- although this is always going to be the case where modules are
operating over the
globalmonitor.Augments the Send_WindowList to allow for an optional monitor name which can
be used to ignore other monitors.
Make FvwmRearrange use the opt-in Send_WindowList command to supply a
monitor name.