-
Notifications
You must be signed in to change notification settings - Fork 341
[WIP] Remove usages of wlr_output_layout_get() #1070
Conversation
yes. looking at the current code, I think it's non-reentrant. |
+1, see #812 |
What about actually removing |
+1 |
include/types/wlr_output_layout.h
Outdated
|
||
#include <wlr/types/wlr_output_layout.h> | ||
|
||
struct wlr_output_layout_output_state { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
If this is private, we need a new way to iterate over the outputs in the layout. |
Can this commit be removed for now so that this PR can br merged? |
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.