macOS: the red close button sends the window to the Dock and the app keeps running (Dock click restores, Cmd+Q quits); a pane shown after being parked is shown before it is sized and told to re-lay out (X drew an empty timeline)
This commit is contained in:
parent
e31f2d3f39
commit
769491ca66
2 changed files with 39 additions and 4 deletions
|
|
@ -919,11 +919,23 @@ pub fn place_tab<R: Runtime>(webview: &Webview<R>, rect: crate::layout::Rect, vi
|
|||
let was_visible = placed.was_visible(webview.label());
|
||||
(placed.place(webview.label(), rect, visible), was_visible)
|
||||
};
|
||||
// macOS: a pane that comes back from hidden (parked at 1x1) and is resized while still hidden keeps
|
||||
// the page's old viewport (X drew an empty timeline until the next real resize). Show it first, then
|
||||
// size it, then tell the page its window changed.
|
||||
#[cfg(target_os = "macos")]
|
||||
let reveal = changed.visible && visible;
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let reveal = false;
|
||||
if reveal {
|
||||
set_tab_visible(webview, visible, parked, was_visible);
|
||||
}
|
||||
if changed.bounds {
|
||||
let (x, y, width, height) = rect;
|
||||
place_child(webview, x, y, width, height);
|
||||
}
|
||||
if changed.visible {
|
||||
if reveal {
|
||||
let _ = webview.eval("window.dispatchEvent(new Event('resize'));");
|
||||
} else if changed.visible {
|
||||
set_tab_visible(webview, visible, parked, was_visible);
|
||||
} else {
|
||||
set_memory_target(webview, visible, parked);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue