From 25b5db13567b70541a3381da4a5a0806e307e42c Mon Sep 17 00:00:00 2001 From: amrbashir <48618675+amrbashir@users.noreply.github.com> Date: Sun, 2 May 2021 04:20:35 +0200 Subject: [PATCH 1/2] fix: only call `show_all` when needed --- src/application/event_loop.rs | 2 +- src/application/window.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/application/event_loop.rs b/src/application/event_loop.rs index 28762f639..270c4829a 100644 --- a/src/application/event_loop.rs +++ b/src/application/event_loop.rs @@ -299,7 +299,7 @@ impl EventLoop { ), WindowRequest::Visible(visible) => { if visible { - window.show(); + window.show_all(); } else { window.hide(); } diff --git a/src/application/window.rs b/src/application/window.rs index ecfe6b6a9..87e8c76c3 100644 --- a/src/application/window.rs +++ b/src/application/window.rs @@ -446,7 +446,6 @@ impl Window { if attributes.maximized { window.maximize(); } - window.set_visible(attributes.visible); window.set_decorated(attributes.decorations); if !attributes.decorations && attributes.resizable { @@ -481,7 +480,11 @@ impl Window { window.set_icon(Some(&icon.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(); From cd1006aa401f87e037d620d35ca7be908bed3552 Mon Sep 17 00:00:00 2001 From: amrbashir <48618675+amrbashir@users.noreply.github.com> Date: Sun, 2 May 2021 04:23:07 +0200 Subject: [PATCH 2/2] add change file --- .changes/gtk-visiblity.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/gtk-visiblity.md diff --git a/.changes/gtk-visiblity.md b/.changes/gtk-visiblity.md new file mode 100644 index 000000000..db92d967d --- /dev/null +++ b/.changes/gtk-visiblity.md @@ -0,0 +1,5 @@ +--- +"wry": patch +--- + +Correctly set visibilty when building `Window` on gtk-backend \ No newline at end of file