Firefox · Widget
CVE-2024-11698
Logic Error in Widget
Overview
Low
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Changed Functions
| Function | Change | Notes |
|---|---|---|
ifwidget/cocoa/nsCocoaWindow.mm |
modified |
Files Changed
widget/cocoa/nsCocoaWindow.mm
Patch
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm
index 0b84bf06f7b..cd1f68e6c61 100644
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -2834,6 +2834,37 @@ void nsCocoaWindow::CocoaWindowDidResize() {
mGeckoWindow->CocoaWindowDidEnterFullscreen(false);
}
+- (void)windowDidFailToEnterFullScreen:(NSNotification*)notification {
+ if (!mGeckoWindow) {
+ return;
+ }
+
+ MOZ_ASSERT((mGeckoWindow->GetCocoaWindow().styleMask &
+ NSWindowStyleMaskFullScreen) == 0);
+ MOZ_ASSERT(mGeckoWindow->SizeMode() == nsSizeMode_Fullscreen);
+
+ // We're in a strange situation. We've told DOM that we are going to
+ // fullscreen by changing our size mode, and therefore the window
+ // content is what we would show if we were properly in fullscreen.
+ // But the window is actually in a windowed style. We have to do
+ // several things:
+ // 1) Clear sWindowInNativeTransition and mTransitionCurrent, both set
+ // when we started the fullscreen transition.
+ // 2) Change our size mode to windowed.
+ // Conveniently, we can do these things by pretending we just arrived
+ // at windowed mode, and all will be sorted out.
+ mGeckoWindow->CocoaWindowDidEnterFullscreen(false);
+}
+
+- (void)windowDidFailToExitFullScreen:(NSNotification*)notification {
+ if (!mGeckoWindow) {
+ return;
+ }
+ // Similarly to windowDidFailToEnterFullScreen, we can get the right
+ // result by pretending we just entered fullscreen.
+ mGeckoWindow->CocoaWindowDidEnterFullscreen(true);
+}
+
- (void)windowDidBecomeMain:(NSNotification*)aNotification {
NS_OBJC_BEGIN_TRY_IGNORE_BLOCK;
Loading diff…
References
On This Page