mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'imbris/macos-fix' into 'master'
Fix macos compilation See merge request veloren/veloren!3743
This commit is contained in:
commit
84f0980dac
@ -469,7 +469,7 @@ impl Window {
|
||||
|
||||
let scale_factor = window.scale_factor();
|
||||
|
||||
let key_layout = match init_keylayout_from_window(&window) {
|
||||
let key_layout = match KeyLayout::new_from_window(&window) {
|
||||
Ok(kl) => Some(kl),
|
||||
Err(err) => {
|
||||
warn!(
|
||||
@ -1390,30 +1390,3 @@ impl Default for FullScreenSettings {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use keyboard_keynames::errors::KeyLayoutError;
|
||||
|
||||
fn init_keylayout_from_window(
|
||||
_window: &winit::window::Window,
|
||||
) -> Result<KeyLayout, KeyLayoutError> {
|
||||
#[cfg(target_family = "unix")]
|
||||
{
|
||||
use keyboard_keynames::key_layout::KeyLayoutExtUnix;
|
||||
use winit::platform::unix::WindowExtUnix;
|
||||
|
||||
match _window.xcb_connection() {
|
||||
Some(_) => KeyLayout::new_x11(),
|
||||
None => KeyLayout::new_wayland(),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_family = "windows")]
|
||||
{
|
||||
Ok(KeyLayout {})
|
||||
}
|
||||
|
||||
#[cfg(all(not(target_family = "unix"), not(target_family = "windows")))]
|
||||
{
|
||||
Err(KeyLayoutError::PlatformUnsupportedError)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user