@@ -874,8 +874,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, const LayoutDeviceIntRect& aRect,
874
874
875
875
MOZ_DIAGNOSTIC_ASSERT (aInitData->mWindowType != WindowType::Invisible);
876
876
877
- mIsTopWidgetWindow = aInitData->mWindowType == WindowType::Dialog ||
878
- aInitData->mWindowType == WindowType::TopLevel;
879
877
mBounds = aRect;
880
878
881
879
// Ensure that the toolkit is created.
@@ -1529,7 +1527,7 @@ nsWindow* nsWindow::GetParentWindow(bool aIncludeOwner) {
1529
1527
}
1530
1528
1531
1529
nsWindow* nsWindow::GetParentWindowBase (bool aIncludeOwner) {
1532
- if (mIsTopWidgetWindow ) {
1530
+ if (IsTopLevelWidget () ) {
1533
1531
// Must use a flag instead of mWindowType to tell if the window is the
1534
1532
// owned by the topmost widget, because a child window can be embedded
1535
1533
// inside a HWND which is not associated with a nsIWidget.
@@ -1960,7 +1958,7 @@ void nsWindow::Move(double aX, double aY) {
1960
1958
#ifdef DEBUG
1961
1959
// complain if a window is moved offscreen (legal, but potentially
1962
1960
// worrisome)
1963
- if (mIsTopWidgetWindow ) { // only a problem for top-level windows
1961
+ if (IsTopLevelWidget () ) { // only a problem for top-level windows
1964
1962
// Make sure this window is actually on the screen before we move it
1965
1963
// XXX: Needs multiple monitor support
1966
1964
HDC dc = ::GetDC (mWnd );
@@ -2267,8 +2265,10 @@ void nsWindow::SuppressAnimation(bool aSuppress) {
2267
2265
// Position (aX, aY) is specified in Windows screen (logical) pixels,
2268
2266
// except when using per-monitor DPI, in which case it's device pixels.
2269
2267
void nsWindow::ConstrainPosition (DesktopIntPoint& aPoint) {
2270
- if (!mIsTopWidgetWindow ) // only a problem for top-level windows
2268
+ if (!IsTopLevelWidget ()) {
2269
+ // only a problem for top-level windows
2271
2270
return ;
2271
+ }
2272
2272
2273
2273
double dpiScale = GetDesktopToDeviceScale ().scale ;
2274
2274
@@ -2748,9 +2748,7 @@ bool nsWindow::UpdateNonClientMargins(bool aReflowWindow) {
2748
2748
}
2749
2749
2750
2750
nsresult nsWindow::SetNonClientMargins (const LayoutDeviceIntMargin& margins) {
2751
- if (!mIsTopWidgetWindow || mBorderStyle == BorderStyle::None ||
2752
- margins.top < -1 || margins.bottom < -1 || margins.left < -1 ||
2753
- margins.right < -1 ) {
2751
+ if (!IsTopLevelWidget () || mBorderStyle == BorderStyle::None) {
2754
2752
return NS_ERROR_INVALID_ARG;
2755
2753
}
2756
2754
@@ -5642,7 +5640,7 @@ bool nsWindow::ProcessMessageInternal(UINT msg, WPARAM& wParam, LPARAM& lParam,
5642
5640
} else {
5643
5641
sJustGotDeactivate = true ;
5644
5642
}
5645
- if (mIsTopWidgetWindow ) {
5643
+ if (IsTopLevelWidget () ) {
5646
5644
mLastKeyboardLayout = KeyboardLayout::GetLayout ();
5647
5645
}
5648
5646
} else {
0 commit comments