Niri-IPC: introduce WindowAreaChanged #1149
Open
+164
−4
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.
Response to #624 .
I have observed that the author has recently been developing many fascinating features, such as floating windows, shadow effects, and tab indicators. I am deeply grateful for the author's diligent work in these areas. After personal experimentation, I found these features not only fascinating but also stable, without any performance degradation.
Compared to other features, this one is relatively minor, yet in the relevant discussions, I have not found anyone submitting a pull request here, so I decided to give it a try myself.
In general, I have introduced a new message type called
WindowAreaChanged
, which includes coordinates, dimensions, and whether it is a floating window.When dealing with scrolling layouts, I found that it is not possible to use relative screen coordinates directly, as other window managers do. Therefore, I believe that floating windows and tiled windows should adopt two different coordinate systems(for
x
), hence the introduction of theis_floating
configuration inWindowArea
.During the traversal of scrolling layouts, the system calculates the sum of xy coordinates, while floating windows directly use the method
tiles_with_offsets
.The effect after using the
niri msg -j event-stream
command is as follows: