-
Notifications
You must be signed in to change notification settings - Fork 341
Make wlr_output_layout_output
private
#1013
Comments
The reason why I would expose it, is to make tweaking the behavior of the While it would certainly be possible to do all of this without the I'm certainly not against making parts of the |
This seems like a good idea, since right now that's all the output layout output is doing. On the other hand @VincentVanlaer has a good point about the extensibility of keeping it around. Though those extensions you have proposed @VincentVanlaer doesn't need the I have no strong feelings either way, but the API surface of wlroots is huge and unless we have good reason to we shouldn't be afraid to make things simpler (since we can always make it more complicated later) |
In the more exposed case, I see two possible interfaces. The first one would be to hide most of the specifics of the struct wlr_output_layout_state;
struct wlr_output_layout {
struct wl_list outputs;
struct wlr_output_layout_state *state;
struct {
struct wl_signal add;
struct wl_signal change;
struct wl_signal destroy;
} events;
void *data;
};
struct wlr_output_layout_output {
struct wl_list link;
struct wlr_output_layout_output_state *state;
struct {
struct wl_signal destroy;
} events;
void *data;
};
...
struct wlr_output_layout_output *wlr_output_layout_get(
struct wlr_output_layout *layout, struct wlr_output *reference);
struct wlr_box *wlr_output_layout_get_box(struct wlr_output_layout *layout,
struct wlr_output_layout_output *reference);
... In case we don't explicitly want to expose the list of struct wlr_output_layout_state;
struct wlr_output_layout {
struct wlr_output_layout_state *state;
struct {
struct wl_signal add;
struct wl_signal change;
struct wl_signal destroy;
} events;
void *data;
};
struct wlr_output_layout_output;
...
struct wlr_output_layout_output *wlr_output_layout_get(
struct wlr_output_layout *layout, struct wlr_output *reference);
struct wlr_output_layout_output *wlr_output_layout_iterate(
struct wlr_output_layout *layout,
struct wlr_output_layout_output *l_output);
struct wlr_box *wlr_output_layout_get_box(struct wlr_output_layout *layout,
struct wlr_output_layout_output *reference);
... I might also be worth noting that |
After some discussion on IRC and #550 (comment) I'm no longer against this. |
Ah ok, not having the ability to iterate over a list of outputs in the layout isn't good and I don't think I like the iterator approach. I'm starting to reconsider this. |
Not a fan of that iterator approach either, it's a little weird. Plus I'm not sure how well it can be wrapped in wlroots-rs (especially if there needs to be clean up? Never dealt with FFI and the iterator traits before). |
Yeah, I think we need it as a list structure. But I think it would be better if that's all it did. Right now, it gets emitted on the layout |
What libwayland does to handle this kind of issue is defining |
The
wlr_output_layout_output
was designed to be private to thewlr_output_layout
. There's no reason to expose it to user code.Looking through the rootston code, it looks like the only use for it is to get the layout x/y coordinates of the output in the layout. This can be accomplished much more cleanly with
wlr_output_layout_get_box()
now.Is there any use case for exposing the
wlr_output_layout_output
to user code?wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:
https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1013
The text was updated successfully, but these errors were encountered: