From 84b45e41578164d1a47bde85ac6a5da3b63f5685 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sun, 12 Apr 2026 00:23:59 +0900 Subject: [PATCH 1/2] wlr-foreign-toplevel-management: add new toplevels to end of list Prior to this patch, when the client binds the manager, the existing toplevel handles were notified in the opposite order of their creation, as wl_list_insert() adds a new handle to the head of the list and wl_list_for_each() iterates from head to tail. --- types/wlr_foreign_toplevel_management_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_foreign_toplevel_management_v1.c b/types/wlr_foreign_toplevel_management_v1.c index c98457a3d..739e4c185 100644 --- a/types/wlr_foreign_toplevel_management_v1.c +++ b/types/wlr_foreign_toplevel_management_v1.c @@ -530,7 +530,7 @@ wlr_foreign_toplevel_handle_v1_create( return NULL; } - wl_list_insert(&manager->toplevels, &toplevel->link); + wl_list_insert(manager->toplevels.prev, &toplevel->link); toplevel->manager = manager; wl_list_init(&toplevel->resources); From 8dd1a7761521bba3b79a1009f1a95377bdfb6488 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sun, 12 Apr 2026 00:22:32 +0900 Subject: [PATCH 2/2] ext-foreign-toplevel-list: add new toplevels to end of list Same as the prior patch for wlr-foreign-toplevel-management. --- types/wlr_ext_foreign_toplevel_list_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_ext_foreign_toplevel_list_v1.c b/types/wlr_ext_foreign_toplevel_list_v1.c index f20ddc877..cb2f21272 100644 --- a/types/wlr_ext_foreign_toplevel_list_v1.c +++ b/types/wlr_ext_foreign_toplevel_list_v1.c @@ -168,7 +168,7 @@ wlr_ext_foreign_toplevel_handle_v1_create(struct wlr_ext_foreign_toplevel_list_v return NULL; } - wl_list_insert(&list->toplevels, &toplevel->link); + wl_list_insert(list->toplevels.prev, &toplevel->link); toplevel->list = list; if (state->app_id) { toplevel->app_id = strdup(state->app_id);