feat: add Window::is_visible (#2169)

* feat: add `Window::is_visible`

* use `Option<bool>`

* update doc

* move it right after `set_visible`
This commit is contained in:
Amr Bashir 2022-02-17 20:44:14 +02:00 committed by GitHub
parent ac1c9b1218
commit f9643917d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 54 additions and 0 deletions

View file

@ -321,6 +321,11 @@ impl Window {
x11_or_wayland!(match self; Window(w) => w.set_visible(visible))
}
#[inline]
pub fn is_visible(&self) -> Option<bool> {
x11_or_wayland!(match self; Window(w) => w.is_visible())
}
#[inline]
pub fn outer_position(&self) -> Result<PhysicalPosition<i32>, NotSupportedError> {
x11_or_wayland!(match self; Window(w) => w.outer_position())

View file

@ -270,6 +270,11 @@ impl Window {
// Not possible on Wayland.
}
#[inline]
pub fn is_visible(&self) -> Option<bool> {
None
}
#[inline]
pub fn outer_position(&self) -> Result<PhysicalPosition<i32>, NotSupportedError> {
Err(NotSupportedError::new())

View file

@ -984,6 +984,11 @@ impl UnownedWindow {
}
}
#[inline]
pub fn is_visible(&self) -> Option<bool> {
None
}
fn update_cached_frame_extents(&self) {
let extents = self
.xconn