]> git.mdlowis.com Git - proto/labwc.git/commit
output: avoid use of wlr_scene_output.WLR_PRIVATE.index
authorJohn Lindgren <john@jlindgren.net>
Tue, 25 Nov 2025 22:36:02 +0000 (17:36 -0500)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 26 Nov 2025 05:49:17 +0000 (06:49 +0100)
commite96f4a032bb091386dfdcd130cf5880f36f34f40
treec69ce842f49bbed91f71abcbcfb9f9ef8d365d37
parent6521067171428b90503fecc898c20467401755d7
output: avoid use of wlr_scene_output.WLR_PRIVATE.index

We were only using it to allow quick bitset comparisons of sets of
outputs (such as view->outputs). We can maintain our own bit IDs for
this purpose and avoid using the private wlroots field.

Note: from my reading of wlr_scene_output_create(), it appears to
always take the lowest unused index, resulting in aggressive re-use of
index values when outputs are disconnected and reconnected. I've tried
to make re-use as infrequent as possible. This could theoretically
reduce the chance of a mix-up in view_update_outputs(), although I'm
not aware of any practical scenario where it matters.

v2: prevent adding more than 64 outputs
include/labwc.h
include/output.h
include/view.h
src/output.c
src/view.c