@@ -873,12 +873,12 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
873
873
widget::InitData defaultInitData;
874
874
if (!aInitData) aInitData = &defaultInitData;
875
875
876
- nsIWidget* baseParent =
877
- aInitData->mWindowType == WindowType::Dialog ||
878
- aInitData->mWindowType == WindowType::TopLevel ||
879
- aInitData->mWindowType == WindowType::Invisible
880
- ? nullptr
881
- : aParent;
876
+ MOZ_DIAGNOSTIC_ASSERT(aInitData->mWindowType != WindowType::Invisible);
877
+
878
+ nsIWidget* baseParent = aInitData->mWindowType == WindowType::Dialog ||
879
+ aInitData->mWindowType == WindowType::TopLevel
880
+ ? nullptr
881
+ : aParent;
882
882
883
883
mIsTopWidgetWindow = (nullptr == baseParent);
884
884
mBounds = aRect;
@@ -888,7 +888,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
888
888
889
889
BaseCreate(baseParent, aInitData);
890
890
891
- HWND parent;
891
+ HWND parent = nullptr ;
892
892
if (aParent) { // has a nsIWidget parent
893
893
parent = aParent ? (HWND)aParent->GetNativeData(NS_NATIVE_WINDOW) : nullptr;
894
894
mParent = aParent;
@@ -913,9 +913,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
913
913
if (!aParent) {
914
914
parent = nullptr;
915
915
}
916
- } else if (mWindowType == WindowType::Invisible) {
917
- // Make sure CreateWindowEx succeeds at creating a toplevel window
918
- desiredStyles.style &= ~WS_CHILDWINDOW;
919
916
} else {
920
917
// See if the caller wants to explictly set clip children and clip siblings
921
918
if (aInitData->mClipChildren) {
@@ -1093,8 +1090,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
1093
1090
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
1094
1091
}
1095
1092
1096
- if (mWindowType != WindowType::Invisible &&
1097
- MouseScrollHandler::Device::IsFakeScrollableWindowNeeded()) {
1093
+ if (MouseScrollHandler::Device::IsFakeScrollableWindowNeeded()) {
1098
1094
// Ugly Thinkpad Driver Hack (Bugs 507222 and 594977)
1099
1095
//
1100
1096
// We create two zero-sized windows as descendants of the top-level window,
@@ -1263,8 +1259,6 @@ static LPWSTR const gStockApplicationIcon = MAKEINTRESOURCEW(32512);
1263
1259
static const wchar_t* ChooseWindowClass(WindowType aWindowType) {
1264
1260
const wchar_t* className = [aWindowType] {
1265
1261
switch (aWindowType) {
1266
- case WindowType::Invisible:
1267
- return kClassNameHidden;
1268
1262
case WindowType::Dialog:
1269
1263
return kClassNameDialog;
1270
1264
case WindowType::Popup:
@@ -1348,7 +1342,6 @@ DWORD nsWindow::WindowStyle() {
1348
1342
[[fallthrough]];
1349
1343
1350
1344
case WindowType::TopLevel:
1351
- case WindowType::Invisible:
1352
1345
style = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_DLGFRAME | WS_BORDER |
1353
1346
WS_THICKFRAME | kTitlebarItemsWindowStyles;
1354
1347
break;
@@ -5858,24 +5851,23 @@ bool nsWindow::ProcessMessageInternal(UINT msg, WPARAM& wParam, LPARAM& lParam,
5858
5851
break;
5859
5852
5860
5853
case WM_GESTURENOTIFY: {
5861
- if (mWindowType != WindowType::Invisible) {
5862
- // A GestureNotify event is dispatched to decide which single-finger
5863
- // panning direction should be active (including none) and if pan
5864
- // feedback should be displayed. Java and plugin windows can make their
5865
- // own calls.
5866
-
5867
- GESTURENOTIFYSTRUCT* gestureinfo = (GESTURENOTIFYSTRUCT*)lParam;
5868
- nsPointWin touchPoint;
5869
- touchPoint = gestureinfo->ptsLocation;
5870
- touchPoint.ScreenToClient(mWnd);
5871
- WidgetGestureNotifyEvent gestureNotifyEvent(true, eGestureNotify, this);
5872
- gestureNotifyEvent.mRefPoint =
5873
- LayoutDeviceIntPoint::FromUnknownPoint(touchPoint);
5874
- nsEventStatus status;
5875
- DispatchEvent(&gestureNotifyEvent, status);
5876
- mDisplayPanFeedback = gestureNotifyEvent.mDisplayPanFeedback;
5877
- if (!mTouchWindow)
5878
- mGesture.SetWinGestureSupport(mWnd, gestureNotifyEvent.mPanDirection);
5854
+ // A GestureNotify event is dispatched to decide which single-finger
5855
+ // panning direction should be active (including none) and if pan
5856
+ // feedback should be displayed. Java and plugin windows can make their
5857
+ // own calls.
5858
+
5859
+ GESTURENOTIFYSTRUCT* gestureinfo = (GESTURENOTIFYSTRUCT*)lParam;
5860
+ nsPointWin touchPoint;
5861
+ touchPoint = gestureinfo->ptsLocation;
5862
+ touchPoint.ScreenToClient(mWnd);
5863
+ WidgetGestureNotifyEvent gestureNotifyEvent(true, eGestureNotify, this);
5864
+ gestureNotifyEvent.mRefPoint =
5865
+ LayoutDeviceIntPoint::FromUnknownPoint(touchPoint);
5866
+ nsEventStatus status;
5867
+ DispatchEvent(&gestureNotifyEvent, status);
5868
+ mDisplayPanFeedback = gestureNotifyEvent.mDisplayPanFeedback;
5869
+ if (!mTouchWindow) {
5870
+ mGesture.SetWinGestureSupport(mWnd, gestureNotifyEvent.mPanDirection);
5879
5871
}
5880
5872
result = false; // should always bubble to DefWindowProc
5881
5873
} break;
@@ -6555,11 +6547,6 @@ void nsWindow::OnWindowPosChanging(WINDOWPOS* info) {
6555
6547
}
6556
6548
}
6557
6549
6558
- // prevent rude external programs from making hidden window visible
6559
- if (mWindowType == WindowType::Invisible) {
6560
- info->flags &= ~SWP_SHOWWINDOW;
6561
- }
6562
-
6563
6550
// When waking from sleep or switching out of tablet mode, Windows 10
6564
6551
// Version 1809 will reopen popup windows that should be hidden. Detect
6565
6552
// this case and refuse to show the window.
@@ -7192,7 +7179,7 @@ a11y::LocalAccessible* nsWindow::GetAccessible() {
7192
7179
if (a11y::PlatformDisabledState() == a11y::ePlatformIsDisabled)
7193
7180
return nullptr;
7194
7181
7195
- if (mInDtor || mOnDestroyCalled || mWindowType == WindowType::Invisible ) {
7182
+ if (mInDtor || mOnDestroyCalled) {
7196
7183
return nullptr;
7197
7184
}
7198
7185
0 commit comments