On 05/12/2016 16:48, Quentin Glidic wrote:
On 05/12/2016 16:29, Pekka Paalanen wrote:
On Mon, 11 Jul 2016 11:29:40 +0200
Quentin Glidic <[email protected]> wrote:
From: Quentin Glidic <[email protected]>
>>> [snip]
+ */
+WL_EXPORT void
+weston_layer_set_position(struct weston_layer *layer,
+ enum weston_layer_position position)
+{
+ struct weston_layer *below;
+
+ layer->position = position;
+ wl_list_for_each_reverse(below, &layer->compositor->layer_list,
link) {
+ if (below->position >= layer->position) {
+ wl_list_insert(&below->link, &layer->link);
+ return;
+ }
+ }
+ wl_list_insert(layer->compositor->layer_list.next, &layer->link);
I think this should not have .next, should it? Now it's adding the new
layer below the top-most layer when it should become the top-most
layer, no?
Honestly I cannot remember why I used .next here… I vaguely remember
something like layers are not ordered as one would think, but that’s
all. I will try to re-figure it out.
FTR, you were right. It’s a leftover from one of the first version of
this code. It did not cause any issue because this branch only triggers
for the fade layer, so the list is empty, then the fade layer
subsequently acts as a catch-all.
--
Quentin “Sardem FF7” Glidic
_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel