This could be prevented if after step 3 focus is set to the pane with all existing tabs.
Hmm, not that simple, since it is possible to have tabs on both split view panes.
Actually, the current behavior (dropping all tabs of the non-focused pane) seems to as well be used in Caja and Nemo. Though sure, restoring them on restart is rather strange
Edit: Ah, sorry, I was wrong .. just ignore waht I said
Thanks for the patch, though I find it rather confusing … I suppose the right thing to do is, to just focus the left notebook on F3(open splitview) instead of the right one. I can as well take a look later on.
If either side pane contains more than one tab, when Split View is turned off, display a warning dialog similar to the already existing "Close window with multiple tabs" including the checkmark not to ask again.
The first patch keeps the focus on the current notebook instead of switching, in order to fix the initial issue .. a rather simple patch (fine to be backported to 4.18 branch)
The second patch re-uses the xfce_dialog_confirm_close_tabs dialog to ask when f3 is pressed while the other notebook has more than one tab open ... that dialog is not a perfect fit .. specially, the option 'close tab' is rather confusing. So I suppose we should not reuse that dialog, but need a new dialog for it without that option. Though the general logic should already be fine.
I can reproduce the crash of the first patch ... moved parts of the second patch to the first one, to prevent the problem ... applied to master and 4.18 branch.
The dialog will need some more love before it can be applied.