Skip to content

Commit

Permalink
Give unimplemented errors for other platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandroll committed May 16, 2024
1 parent 0a621f2 commit 7e4f69e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ pub mod window {
}

/// Get the position of the window.
/// TODO: implement for other platforms
#[cfg(target_os = "windows")]
pub fn get_window_position() -> (u32, u32) {
let mut d = native_display().lock().unwrap();
d.screen_position
Expand Down
3 changes: 3 additions & 0 deletions src/native/linux_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ impl X11Display {
new_width,
new_height,
} => self.set_window_size(self.window, new_width as _, new_height as _),
SetWindowPosition { new_x, new_y } => {
eprintln!("Not implemented for X11")
}
SetFullscreen(fullscreen) => self.set_fullscreen(self.window, fullscreen),
ShowKeyboard(show) => {
eprintln!("Not implemented for X11")
Expand Down
3 changes: 3 additions & 0 deletions src/native/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ impl MacosDisplay {
new_height,
} => self.set_window_size(new_width as _, new_height as _),
SetFullscreen(fullscreen) => self.set_fullscreen(fullscreen),
SetWindowPosition{new_x, new_y} => {
eprintln!("Not implemented for macos");
}
_ => {}
}
}
Expand Down

0 comments on commit 7e4f69e

Please sign in to comment.