This bug has been there for a long time. Tested on multiple machines. Steps to reproduce: 1. Open a program with some modal dialog (e.g. XFCE Terminal with Preferences dialog, Geany with Find dialog...); 2. Switch to another window whose size and position cover the main window of the program opened in 1 (any maximised window will do); 3. Using the Window Buttons panel button on XFCE panel, click the button corresponding to the program opened in 1. Expected behaviour: the program opened in step 1 would be shown again, with its main window behind its modal dialog just as it was before switching. Current behaviour: only the modal dialog is displayed (i.e. we only see the terminal's preference dialog, the terminal itself doesn't reappear; on Geany, the text editor doesn't come back, and we only see the search dialog). If we press Alt+Tab rather than clicking the panel button, everything works properly, but I don't think it's the panel's fault because other WMs do not have this problem even with Xfce panel (tested: Compiz and KWin).
Olivier Fourdan referenced this bugreport in commit fa9517eae823e35d0c85276b2d0c31beede5022f stacking: Raise all transients together https://git.xfce.org/xfce/xfwm4/commit?id=fa9517eae823e35d0c85276b2d0c31beede5022f
Olivier Fourdan referenced this bugreport in commit 2a23df9272523fd0c1e5d8286f729640cab87b28 cycle: No need to raise parents separately https://git.xfce.org/xfce/xfwm4/commit?id=2a23df9272523fd0c1e5d8286f729640cab87b28
I have compiled Xfwm4 after the latest commits and tested it on my computers. This bug is now fixed, and nothing seems to be broken. Thank you so much for the quick solution!
Thank you for testing!