зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1531226 - Add support for alwaysontop windows for macOS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D50275 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e63ea2e660
Коммит
6d2e7437f0
|
@ -389,6 +389,7 @@ class nsCocoaWindow final : public nsBaseWidget, public nsPIWidgetCocoa {
|
|||
bool mInReportMoveEvent; // true if in a call to ReportMoveEvent().
|
||||
bool mInResize; // true if in a call to DoResize().
|
||||
bool mWindowTransformIsIdentity;
|
||||
bool mAlwaysOnTop;
|
||||
|
||||
int32_t mNumModalDescendents;
|
||||
InputContext mInputContext;
|
||||
|
|
|
@ -154,6 +154,7 @@ nsCocoaWindow::nsCocoaWindow()
|
|||
mInReportMoveEvent(false),
|
||||
mInResize(false),
|
||||
mWindowTransformIsIdentity(true),
|
||||
mAlwaysOnTop(false),
|
||||
mNumModalDescendents(0),
|
||||
mWindowAnimationBehavior(NSWindowAnimationBehaviorDefault) {
|
||||
if ([NSWindow respondsToSelector:@selector(setAllowsAutomaticWindowTabbing:)]) {
|
||||
|
@ -302,6 +303,7 @@ nsresult nsCocoaWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
|
|||
|
||||
mParent = aParent;
|
||||
mAncestorLink = aParent;
|
||||
mAlwaysOnTop = aInitData->mAlwaysOnTop;
|
||||
|
||||
// Applications that use native popups don't want us to create popup windows.
|
||||
if ((mWindowType == eWindowType_popup) && UseNativePopupWindows()) return NS_OK;
|
||||
|
@ -482,6 +484,10 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect& aRect, nsBorderStyle aB
|
|||
[mWindow setOpaque:YES];
|
||||
}
|
||||
|
||||
if (mAlwaysOnTop) {
|
||||
[mWindow setLevel:NSFloatingWindowLevel];
|
||||
}
|
||||
|
||||
[mWindow setContentMinSize:NSMakeSize(60, 60)];
|
||||
[mWindow disableCursorRects];
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче