Fix only call show_all when needed

This commit is contained in:
Ngo Iok Ui
2021-05-02 18:44:52 +08:00
parent d35386d61d
commit a710e04755
2 changed files with 6 additions and 2 deletions

View File

@@ -192,7 +192,7 @@ impl<T: 'static> EventLoop<T> {
),
WindowRequest::Visible(visible) => {
if visible {
window.show();
window.show_all();
} else {
window.hide();
}

View File

@@ -237,7 +237,11 @@ impl Window {
window.set_icon(Some(&icon.inner.into()));
}
window.show_all();
if attributes.visible {
window.show_all();
} else {
window.hide();
}
let window_requests_tx = event_loop_window_target.window_requests_tx.clone();