Skip to content

Commit 056c5af

Browse files
authored
Fix is_active requiring &mut self rather than &self (#376)
1 parent 1d80032 commit 056c5af

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ impl Window {
859859

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

src/os/macos/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ extern "C" {
181181
fn mfb_set_cursor_visibility(window: *mut c_void, visibility: bool);
182182
fn mfb_should_close(window: *mut c_void) -> i32;
183183
fn mfb_get_screen_size() -> u32;
184-
fn mfb_is_active(window: *mut c_void) -> u32;
184+
fn mfb_is_active(window: *const c_void) -> u32;
185185
fn mfb_add_menu(window: *mut c_void, menu: *mut c_void) -> u64;
186186
fn mfb_add_sub_menu(parent_menu: *mut c_void, name: *const c_char, menu: *mut c_void);
187187
fn mfb_active_menu(window: *mut c_void) -> i32;
@@ -574,7 +574,7 @@ impl Window {
574574
}
575575

576576
#[inline]
577-
pub fn is_active(&mut self) -> bool {
577+
pub fn is_active(&self) -> bool {
578578
unsafe { mfb_is_active(self.window_handle) == 0 }
579579
}
580580

src/os/posix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl Window {
324324
}
325325
}
326326

327-
pub fn is_active(&mut self) -> bool {
327+
pub fn is_active(&self) -> bool {
328328
match self {
329329
#[cfg(feature = "x11")]
330330
Window::X11(w) => w.is_active(),

src/os/posix/x11.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ impl Window {
818818
}
819819

820820
#[inline]
821-
pub fn is_active(&mut self) -> bool {
821+
pub fn is_active(&self) -> bool {
822822
self.active
823823
}
824824

src/os/redox/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl Window {
247247
}
248248

249249
#[inline]
250-
pub fn is_active(&mut self) -> bool {
250+
pub fn is_active(&self) -> bool {
251251
self.is_active
252252
}
253253

src/os/wasm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl Window {
423423
}
424424

425425
#[inline]
426-
pub fn is_active(&mut self) -> bool {
426+
pub fn is_active(&self) -> bool {
427427
window()
428428
.and_then(|window| window.document())
429429
.and_then(|document| document.active_element())

src/os/windows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ impl Window {
10021002
}
10031003

10041004
#[inline]
1005-
pub fn is_active(&mut self) -> bool {
1005+
pub fn is_active(&self) -> bool {
10061006
let active = unsafe { winapi::um::winuser::GetActiveWindow() };
10071007
!active.is_null() && active == self.hwnd
10081008
}

0 commit comments

Comments
 (0)