Skip to content

Commit aba7e22

Browse files
committed
Bug 1880226 - Approach 1: Keep WS_EX_DLGMODALFRAME for dialogs. r=win-reviewers,rkraesig
This restores the behavior pre-patch. Bug 1878037 removed this flag because it didn't affect borders, as documented in MSDN: https://learn.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles But apparently it has other side effects like suppressing the icon (?). Differential Revision: https://phabricator.services.mozilla.com/D201889
1 parent 1f86412 commit aba7e22

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

widget/windows/nsWindow.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -1332,30 +1332,29 @@ DWORD nsWindow::WindowStyle() {
13321332

13331333
// Return nsWindow extended styles
13341334
DWORD nsWindow::WindowExStyle() {
1335+
MOZ_ASSERT_IF(mIsAlert, mWindowType == WindowType::Dialog);
13351336
switch (mWindowType) {
13361337
case WindowType::Child:
13371338
return 0;
1338-
13391339
case WindowType::Popup: {
13401340
DWORD extendedStyle = WS_EX_TOOLWINDOW;
13411341
if (mPopupLevel == PopupLevel::Top) {
13421342
extendedStyle |= WS_EX_TOPMOST;
13431343
}
13441344
return extendedStyle;
13451345
}
1346-
1346+
case WindowType::Dialog: {
1347+
if (mIsAlert) {
1348+
return WS_EX_TOOLWINDOW;
1349+
}
1350+
return WS_EX_WINDOWEDGE | WS_EX_DLGMODALFRAME;
1351+
}
13471352
case WindowType::Sheet:
13481353
MOZ_FALLTHROUGH_ASSERT("Sheets are macOS specific");
1349-
case WindowType::Dialog:
13501354
case WindowType::TopLevel:
13511355
case WindowType::Invisible:
13521356
break;
13531357
}
1354-
if (mIsAlert) {
1355-
MOZ_ASSERT(mWindowType == WindowType::Dialog,
1356-
"Expect alert windows to have type=dialog");
1357-
return WS_EX_TOOLWINDOW;
1358-
}
13591358
return WS_EX_WINDOWEDGE;
13601359
}
13611360

0 commit comments

Comments
 (0)