[Bug] Pannel assigned to a particular monitor not hidden if monitor not exists
The panel has the option to assign it to a particular monitor. This works pretty well and there is also code to hide the panel if the particular monitor does not exist:
https://gitlab.xfce.org/xfce/xfce4-panel/-/blob/master/panel/panel-window.c#L2292
Unfortunately, the code seems not to be used in all cases. I'm playing around with xrandr and multiple virtual monitors (using the patches discussed in https://gitlab.gnome.org/GNOME/gtk/-/issues/2013. I create 2 virtual monitors and assign one panel to each. Then I remove the monitors. The panel is still shown.
Here's the debug output when switching from 2 to 1 monitors:
xfce4-panel(display-layout): 0x56393506a680: display=:0.0{comp=true}, screen-0[0x563934e28020]=[3440,1440] (Monitor-0=[0,0;3440,1440])
xfce4-panel(positioning): 0x56393506a680: screen=0x563934e28020, monitors=1, output-name=Monitor-0, span-monitors=false, base=758,1426
xfce4-panel(positioning): 0x56393506a680: working-area: screen=0x563934e28020, x=0, y=0, w=3440, h=1440
xfce4-panel(display-layout): 0x5639350bfac0: display=:0.0{comp=true}, screen-0[0x563934e28020]=[3440,1440] (Monitor-0=[0,0;3440,1440])
xfce4-panel(positioning): 0x5639350bfac0: screen=0x563934e28020, monitors=1, output-name=Monitor-1, span-monitors=false, base=2480,1426
xfce4-panel(positioning): 0x5639350bfac0: working-area: screen=0x563934e28020, x=0, y=0, w=3440, h=1440
xfce4-panel(struts): 0x56393506a680: bottom=27, start_x=0, end_x=3439
xfce4-panel(struts): 0x5639350bfac0: bottom=46, start_x=0, end_x=1271
xfce4-panel(display-layout): 0x56393506a680: display=:0.0{comp=true}, screen-0[0x563934e28020]=[3440,1440] (Monitor-0=[0,0;3440,1440])
xfce4-panel(positioning): 0x56393506a680: screen=0x563934e28020, monitors=1, output-name=Monitor-0, span-monitors=false, base=758,1426
xfce4-panel(positioning): 0x56393506a680: working-area: screen=0x563934e28020, x=0, y=0, w=3440, h=1440
xfce4-panel(display-layout): 0x5639350bfac0: display=:0.0{comp=true}, screen-0[0x563934e28020]=[3440,1440] (Monitor-0=[0,0;3440,1440])
xfce4-panel(positioning): 0x5639350bfac0: screen=0x563934e28020, monitors=1, output-name=Monitor-1, span-monitors=false, base=2480,1426
xfce4-panel(positioning): 0x5639350bfac0: working-area: screen=0x563934e28020, x=0, y=0, w=3440, h=1440
xfce4-panel(base-window): 0x56393506a680: compositing=false
xfce4-panel(base-window): 0x5639350bfac0: compositing=false
xfce4-panel(base-window): 0x56393506a680: compositing=true
xfce4-panel(base-window): 0x5639350bfac0: compositing=true