Bug 1877749: Prevent nsCocoaWindow from forgetting transitions during transitory...
commitb4e4ce39b00026234c15c2dce075def2a5b55765
authorBrad Werth <bwerth@mozilla.com>
Tue, 6 Feb 2024 21:59:44 +0000 (6 21:59 +0000)
committerBrad Werth <bwerth@mozilla.com>
Tue, 6 Feb 2024 21:59:44 +0000 (6 21:59 +0000)
treeb4487f25e1200f2fb3eb5f744a9995d158488949
parente68568b5113731863f4406824c594c7677c34d47
Bug 1877749: Prevent nsCocoaWindow from forgetting transitions during transitory window rebuilds. r=mstange

DestroyNativeWindow() is called for permanent window destruction, but it
is also called for transitory window recreated in HideWindowChrome().
When the nsCocoaWindow itself is also expected to be destroyed, it's
useful to clear out transitions. But when the nsCocoaWindow is expected
to persist (with a new mWindow instance), it's unhelpful to clear the
transitions, because emulated fullscreen relies on transition
continuity.

This change further simplifies DestroyNativeWindow so it does only the
bare-minimum, always-needed things before forgetting mWindow and its
delegate. The higher-level concern of clearing out transitions is
factored out into a new function CancelAllTransitions, which is invoked
by callers when appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D200215
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm