Crash with multiple outputs and layer surfaces
WLR_X11_OUTPUTS=2 WLR_BACKENDS=x11 _build/src/phoc -E "/usr/libexec/phosh"
leads to recursion with multple outputs like
(gdb) #0 0x00007fe0aff647fe in handle_array (resource=resource@entry=0x55ffc790aea0, opcode=opcode@entry=1, args=args@entry=0x7fff2b001060, send_func=0x7fe0aff6a680 <wl_closure_send>) at ../src/wayland-server.c:206
#1 0x00007fe0aff64e6c in wl_resource_post_event_array (resource=resource@entry=0x55ffc790aea0, opcode=opcode@entry=1, args=args@entry=0x7fff2b001060) at ../src/wayland-server.c:238
#2 0x00007fe0aff64f5f in wl_resource_post_event (resource=resource@entry=0x55ffc790aea0, opcode=opcode@entry=1) at ../src/wayland-server.c:253
#3 0x000055ffc5123c71 in gtk_primary_selection_device_send_selection (id=0x0, resource_=0x55ffc790aea0) at subprojects/wlroots/protocol/gtk-primary-selection-protocol.h:298
#4 device_resource_send_selection (source=0x0, resource=0x55ffc790aea0) at ../subprojects/wlroots/types/wlr_gtk_primary_selection.c:248
#5 device_send_selection (device=0x55ffc7aac910) at ../subprojects/wlroots/types/wlr_gtk_primary_selection.c:263
#6 0x000055ffc513885c in wlr_signal_emit_safe (signal=signal@entry=0x55ffc77a7510, data=data@entry=0x7fff2b0012b0) at ../subprojects/wlroots/util/signal.c:29
#7 0x000055ffc5113dac in wlr_seat_keyboard_enter (seat=<optimized out>, surface=0x55ffc7a12770, keycodes=<optimized out>, num_keycodes=<optimized out>, modifiers=0x55ffc7010438)
at ../subprojects/wlroots/types/seat/wlr_seat_keyboard.c:313
#8 0x000055ffc50ed0b9 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x55ffc78b9cd0) at ../src/seat.c:1758
#9 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010690 [PhocOutput]) at ../src/layer_shell.c:339
#10 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#11 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#12 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#13 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#14 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#15 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#16 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#17 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#18 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#19 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#20 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#21 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#22 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#23 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#24 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#25 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
#26 0x000055ffc50ed138 in phoc_seat_set_focus_layer (seat=seat@entry=0x55ffc77a8000 [PhocSeat], layer=0x0) at ../src/seat.c:1738
#27 0x000055ffc50e581e in arrange_layers (output=output@entry=0x7fe088010540 [PhocOutput]) at ../src/layer_shell.c:339
Reverting 15f6d748 works around this. @dos could you have a look?