Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

[WIP] Remove usages of wlr_output_layout_get() #1070

Closed
wants to merge 4 commits into from

Conversation

acrisci
Copy link

@acrisci acrisci commented Jun 19, 2018

Getting the box works just as good.

Fixes #1013
Fixes #812

What do you think about changing wlr_output_layout_get_box() to accept a reference to the box as an output variable instead of returning a pointer? That seems to be what we've done in other places.

@Ongy
Copy link

Ongy commented Jun 20, 2018

What do you think about changing wlr_output_layout_get_box() to accept a reference to the box as an output variable instead of returning a pointer?

yes. looking at the current code, I think it's non-reentrant.
While it's not a huge problem with wlroots being single-threaded in general, it's not a good idea either.

@emersion
Copy link
Member

What do you think about changing wlr_output_layout_get_box() to accept a reference to the box as an output variable instead of returning a pointer? That seems to be what we've done in other places.

+1, see #812

emersion
emersion previously approved these changes Jun 20, 2018
@emersion
Copy link
Member

What about actually removing wlr_output_layout_get and making wlr_output_layout_output private?

@ddevault
Copy link
Contributor

What do you think about changing wlr_output_layout_get_box() to accept a reference to the box as an output variable instead of returning a pointer? That seems to be what we've done in other places.

+1


#include <wlr/types/wlr_output_layout.h>

struct wlr_output_layout_output_state {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to keep this around?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think the whole point of this state struct was to keep some stuff private.

struct wlr_box mapping;
if (!get_mapping(cur, dev, &mapping) &&
!wlr_output_layout_get_box(cur->state->layout, NULL, &mapping)) {
// no outputs in the layout
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dunno what to do here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting everything to zero is sane.

@@ -6,6 +6,7 @@
#include <wlr/types/wlr_xdg_output.h>
#include <wlr/util/log.h>
#include "xdg-output-unstable-v1-protocol.h"
#include "types/wlr_output_layout.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. I'm not a fan of this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this interface can probably just work with the wlr_output. wlr_cursor.c uses it too.

struct wl_listener output_destroy;
};

struct wlr_output_layout_output *wlr_output_layout_get(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function will be exported because it has the wlr_ prefix. If it's in a private header, it shouldn't.

@acrisci
Copy link
Author

acrisci commented Jun 20, 2018

If this is private, we need a new way to iterate over the outputs in the layout.

@emersion emersion dismissed their stale review June 30, 2018 11:52

Outdated

@emersion
Copy link
Member

emersion commented Jul 8, 2018

make wlr_output_layout_output private

Can this commit be removed for now so that this PR can br merged?

@emersion emersion changed the title remove usages of wlr_output_layout_get() [WIP] Remove usages of wlr_output_layout_get() Jul 9, 2018
@emersion emersion added the breaking Breaking change in public API label Dec 2, 2018
@panaman67
Copy link

bump @acrisci @emersion

@ddevault ddevault closed this Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

Make wlr_output_layout_output private Make wlr_output_layout_get_box take a box as parameter
5 participants