mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: crash when calling BrowserWindow.moveTop() on modal children (#39527)
fix: crash when calling moveTop() on modal children Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -814,7 +814,7 @@ bool NativeWindowMac::MoveAbove(const std::string& sourceId) {
|
||||
if (!webrtc::GetWindowOwnerPid(window_id))
|
||||
return false;
|
||||
|
||||
if (!parent()) {
|
||||
if (!parent() || is_modal()) {
|
||||
[window_ orderWindow:NSWindowAbove relativeTo:window_id];
|
||||
} else {
|
||||
NSWindow* other_window = [NSApp windowWithWindowNumber:window_id];
|
||||
@@ -825,10 +825,11 @@ bool NativeWindowMac::MoveAbove(const std::string& sourceId) {
|
||||
}
|
||||
|
||||
void NativeWindowMac::MoveTop() {
|
||||
if (!parent())
|
||||
if (!parent() || is_modal()) {
|
||||
[window_ orderWindow:NSWindowAbove relativeTo:0];
|
||||
else
|
||||
} else {
|
||||
ReorderChildWindowAbove(window_, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetResizable(bool resizable) {
|
||||
|
||||
Reference in New Issue
Block a user