mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +09:00
Issue #1491 - Part 2: Disable a workaround on macOS 10.14+ for an Apple bug described in Mozilla bug 378645 involving popup windows that was fixed by Apple.
This commit is contained in:
parent
d33ab8621a
commit
186c726563
1 changed files with 27 additions and 20 deletions
|
|
@ -810,15 +810,17 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mWindowType == eWindowType_popup) {
|
else if (mWindowType == eWindowType_popup) {
|
||||||
// If a popup window is shown after being hidden, it needs to be "reset"
|
if (!nsCocoaFeatures::OnMojaveOrLater()) {
|
||||||
// for it to receive any mouse events aside from mouse-moved events
|
// If a popup window is shown after being hidden, it needs to be "reset"
|
||||||
// (because it was removed from the "window cache" when it was hidden
|
// for it to receive any mouse events aside from mouse-moved events
|
||||||
// -- see below). Setting the window number to -1 and then back to its
|
// (because it was removed from the "window cache" when it was hidden
|
||||||
// original value seems to accomplish this. The idea was "borrowed"
|
// -- see below). Setting the window number to -1 and then back to its
|
||||||
// from the Java Embedding Plugin.
|
// original value seems to accomplish this. The idea was "borrowed"
|
||||||
NSInteger windowNumber = [mWindow windowNumber];
|
// from the Java Embedding Plugin. This is fixed on macOS 10.14+.
|
||||||
[mWindow _setWindowNumber:-1];
|
NSInteger windowNumber = [mWindow windowNumber];
|
||||||
[mWindow _setWindowNumber:windowNumber];
|
[mWindow _setWindowNumber:-1];
|
||||||
|
[mWindow _setWindowNumber:windowNumber];
|
||||||
|
}
|
||||||
// For reasons that aren't yet clear, calls to [NSWindow orderFront:] or
|
// For reasons that aren't yet clear, calls to [NSWindow orderFront:] or
|
||||||
// [NSWindow makeKeyAndOrderFront:] can sometimes trigger "Error (1000)
|
// [NSWindow makeKeyAndOrderFront:] can sometimes trigger "Error (1000)
|
||||||
// creating CGSWindow", which in turn triggers an internal inconsistency
|
// creating CGSWindow", which in turn triggers an internal inconsistency
|
||||||
|
|
@ -951,17 +953,22 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
|
||||||
[nativeParentWindow removeChildWindow:mWindow];
|
[nativeParentWindow removeChildWindow:mWindow];
|
||||||
|
|
||||||
[mWindow orderOut:nil];
|
[mWindow orderOut:nil];
|
||||||
// Unless it's explicitly removed from NSApp's "window cache", a popup
|
|
||||||
// window will keep receiving mouse-moved events even after it's been
|
if (!nsCocoaFeatures::OnMojaveOrLater()) {
|
||||||
// "ordered out" (instead of the browser window that was underneath it,
|
// Unless it's explicitly removed from NSApp's "window cache", a popup
|
||||||
// until you click on that window). This is bmo bug 378645, but it's
|
// window will keep receiving mouse-moved events even after it's been
|
||||||
// surely an Apple bug. The "window cache" is an undocumented subsystem,
|
// "ordered out" (instead of the browser window that was underneath it,
|
||||||
// all of whose methods are included in the NSWindowCache category of
|
// until you click on that window). This is bmo bug 378645, but it's
|
||||||
// the NSApplication class (in header files generated using class-dump).
|
// surely an Apple bug. The "window cache" is an undocumented
|
||||||
// This workaround was "borrowed" from the Java Embedding Plugin (which
|
// subsystem, all of whose methods are included in the NSWindowCache
|
||||||
// uses it for a different purpose).
|
// category of the NSApplication class (in header files generated using
|
||||||
if (mWindowType == eWindowType_popup)
|
// class-dump). This workaround was "borrowed" from the Java Embedding
|
||||||
[NSApp _removeWindowFromCache:mWindow];
|
// Plugin (which uses it for a different purpose). This is fixed on
|
||||||
|
// macOS 10.14+.
|
||||||
|
if (mWindowType == eWindowType_popup) {
|
||||||
|
[NSApp _removeWindowFromCache:mWindow];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If our popup window is a non-native context menu, tell the OS (and
|
// If our popup window is a non-native context menu, tell the OS (and
|
||||||
// other programs) that a menu has closed.
|
// other programs) that a menu has closed.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue