From 8ef9fe44c7bb0352997898b793e361ea749e4883 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sun, 12 Jun 2022 09:53:28 +0300 Subject: [PATCH] Add `WindowBuilder::transparent` This is required to help hardware accelerated libraries like glutin that accept WindowBuilder instead of RawWindowHandle, since the api to access builder properties directly was removed. Follow up to 44288f6. --- CHANGELOG.md | 1 + src/window.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d103cdb..d98478e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ And please only add new entries to the top of this list, right below the `# Unre - Build docs on `docs.rs` for iOS and Android as well. - **Breaking:** Removed the `WindowAttributes` struct, since all its functionality is accessible from `WindowBuilder`. +- Added `WindowBuilder::transparent` getter to check if the user set `transparent` attribute. - On macOS, Fix emitting `Event::LoopDestroyed` on CMD+Q. - On macOS, fixed an issue where having multiple windows would prevent run_return from ever returning. - On Wayland, fix bug where the cursor wouldn't hide in GNOME. diff --git a/src/window.rs b/src/window.rs index 1a1ded6f..50fcdbdc 100644 --- a/src/window.rs +++ b/src/window.rs @@ -278,6 +278,12 @@ impl WindowBuilder { self } + /// Get whether the window will support transparency. + #[inline] + pub fn transparent(&self) -> bool { + self.window.transparent + } + /// Sets whether the window should have a border, a title bar, etc. /// /// The default is `true`.