Skip to content

Commit 4b640be

Browse files
author
Zitro
committed
Fixing up OS conflicts
1 parent 9840deb commit 4b640be

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

crates/bevy_winit/src/winit_windows.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ use bevy_window::{Window, WindowDescriptor, WindowId, WindowMode};
44
use raw_window_handle::HasRawWindowHandle;
55
use winit::dpi::LogicalSize;
66

7-
#[cfg(any(feature = "x11", feature = "wayland"))]
7+
#[cfg(all(
8+
any(
9+
target_os = "linux",
10+
target_os = "freebsd",
11+
target_os = "netbsd",
12+
target_os = "openbsd"
13+
),
14+
any(feature = "x11", feature = "wayland")
15+
))]
816
use winit::platform::unix::WindowBuilderExtUnix;
917

1018
#[derive(Debug, Default)]
@@ -106,7 +114,15 @@ impl WinitWindows {
106114
let mut winit_window_builder = winit_window_builder.with_title(&window_descriptor.title);
107115

108116
#[allow(unused_mut)]
109-
#[cfg(feature = "x11")]
117+
#[cfg(all(
118+
any(
119+
target_os = "linux",
120+
target_os = "freebsd",
121+
target_os = "netbsd",
122+
target_os = "openbsd"
123+
),
124+
feature = "x11"
125+
))]
110126
let mut winit_window_builder = winit_window_builder.with_class(
111127
window_descriptor.desktop_instance.clone(), // that's actually wm_instance
112128
window_descriptor.desktop_id.clone(), // and that's wm_class
@@ -125,7 +141,15 @@ impl WinitWindows {
125141
*/
126142

127143
#[allow(unused_mut)]
128-
#[cfg(feature = "wayland")]
144+
#[cfg(all(
145+
any(
146+
target_os = "linux",
147+
target_os = "freebsd",
148+
target_os = "netbsd",
149+
target_os = "openbsd"
150+
),
151+
feature = "wayland"
152+
))]
129153
let mut winit_window_builder =
130154
winit_window_builder.with_app_id(window_descriptor.desktop_id.clone());
131155

0 commit comments

Comments
 (0)