On reanalysis, my initial patch didn't constitute a solution... and can't really be levered into becoming one. I don't see a way to solve this, as written, without either _a)_ an unenforceable requirement on the host application to ask before reparenting ancestors of a Gecko window's HWND to new root windows, or _b)_ hooking all window-reparent events in the host application and checking whether they'd affect any Gecko windows which might have file-dialogs open. I believe the latter _is_ technically feasible, but it's a lot of present-day effort and future maintenance work for a use-case which not only hasn't been requested, but quite plausibly won't be before Microsoft reworks the file-dialog implementation again. (If you have such a use-case, we're willing to revisit this to find a reasonable solution.) In the meantime, I plan to land the above patch — which does at least ameliorate this slightly — and then close this bug as RESOLVED WONTFIX.
Bug 1879608 Comment 3 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
On reanalysis, my initial patch didn't constitute a solution... and can't really be levered into becoming one. I don't see a way to solve this, as written, without either _a)_ an unenforceable requirement on the host application to ask before reparenting ancestors of a Gecko window's HWND to new root windows, or _b)_ hooking all window-reparent events in the host application and checking whether they'd affect any Gecko windows which might have file-dialogs open. I believe the latter _is_ technically feasible, but it's a lot of present-day effort and future maintenance work for a use-case which not only hasn't been requested, but quite plausibly won't be before Microsoft reworks the file-dialog implementation again. If you have such a use-case, we're willing to revisit this to find a reasonable solution. In the meantime, I plan to land the above patch — which does at least ameliorate this slightly — and then close this bug as RESOLVED WONTFIX.