Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ impl Window {

/// Returns if this windows is the current active one
#[inline]
pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
self.0.is_active()
}

Expand Down
4 changes: 2 additions & 2 deletions src/os/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ extern "C" {
fn mfb_set_cursor_visibility(window: *mut c_void, visibility: bool);
fn mfb_should_close(window: *mut c_void) -> i32;
fn mfb_get_screen_size() -> u32;
fn mfb_is_active(window: *mut c_void) -> u32;
fn mfb_is_active(window: *const c_void) -> u32;
fn mfb_add_menu(window: *mut c_void, menu: *mut c_void) -> u64;
fn mfb_add_sub_menu(parent_menu: *mut c_void, name: *const c_char, menu: *mut c_void);
fn mfb_active_menu(window: *mut c_void) -> i32;
Expand Down Expand Up @@ -574,7 +574,7 @@ impl Window {
}

#[inline]
pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
unsafe { mfb_is_active(self.window_handle) == 0 }
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/posix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl Window {
}
}

pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
match self {
#[cfg(feature = "x11")]
Window::X11(w) => w.is_active(),
Expand Down
2 changes: 1 addition & 1 deletion src/os/posix/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ impl Window {
}

#[inline]
pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
self.active
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl Window {
}

#[inline]
pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
self.is_active
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl Window {
}

#[inline]
pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
window()
.and_then(|window| window.document())
.and_then(|document| document.active_element())
Expand Down
2 changes: 1 addition & 1 deletion src/os/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ impl Window {
}

#[inline]
pub fn is_active(&mut self) -> bool {
pub fn is_active(&self) -> bool {
let active = unsafe { winapi::um::winuser::GetActiveWindow() };
!active.is_null() && active == self.hwnd
}
Expand Down
Loading