Skip to content
Open
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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ opengl = [
keyboard-types = { version = "0.6.1", default-features = false }
raw-window-handle = "0.5"

[target.'cfg(target_os="linux")'.dependencies]
[target.'cfg(any(target_os="linux", target_os="freebsd"))'.dependencies]
x11rb = { version = "0.13.2", features = ["cursor", "resource_manager", "allow-unsafe-code", "dl-libxcb"], default-features = false }
x11-dl = { version = "2.21" }
polling = "3.11.0"
Expand Down
2 changes: 2 additions & 0 deletions src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::macos as platform;
use crate::win as platform;
#[cfg(target_os = "linux")]
use crate::x11 as platform;
#[cfg(target_os = "freebsd")]
use crate::x11 as platform;

pub fn copy_to_clipboard(data: &str) {
platform::copy_to_clipboard(data)
Expand Down
7 changes: 6 additions & 1 deletion src/gl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ pub(crate) mod x11;
#[cfg(target_os = "linux")]
pub(crate) use self::x11 as platform;

#[cfg(target_os = "freebsd")]
pub(crate) mod x11;
#[cfg(target_os = "freebsd")]
pub(crate) use self::x11 as platform;

#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "macos")]
Expand Down Expand Up @@ -93,7 +98,7 @@ impl GlContext {
/// The X11 version needs to be set up in a different way compared to the Windows and macOS
/// versions. So the platform-specific versions should be used to construct the context within
/// baseview, and then this object can be passed to the user.
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub(crate) fn new(context: platform::GlContext) -> GlContext {
GlContext { context: AssertUnwindSafe(context), phantom: PhantomData }
}
Expand Down
4 changes: 2 additions & 2 deletions src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

//! Keyboard types.

#[cfg(any(target_os = "linux", target_os = "macos"))]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))]
use keyboard_types::{Code, Location};

#[cfg(any(target_os = "linux", target_os = "macos"))]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))]
/// Map key code to location.
///
/// The logic for this is adapted from InitKeyEvent in TextInputHandler (in the Mozilla
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ mod macos;
mod win;
#[cfg(target_os = "linux")]
pub(crate) mod x11;
#[cfg(target_os = "freebsd")]
mod x11;

mod clipboard;
mod event;
Expand Down
2 changes: 2 additions & 0 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use crate::macos as platform;
use crate::win as platform;
#[cfg(target_os = "linux")]
use crate::x11 as platform;
#[cfg(target_os = "freebsd")]
use crate::x11 as platform;

pub struct WindowHandle {
window_handle: platform::WindowHandle,
Expand Down
6 changes: 3 additions & 3 deletions src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
//! Otherwise, this should be considered a bug and reported accordingly.

/// Wrappers and utilities around Xlib. (provided by x11_dl)
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub mod xlib;

/// Wrappers and utilities around GLX
#[cfg(all(target_os = "linux", feature = "opengl"))]
#[cfg(all(any(target_os = "linux", target_os = "freebsd"), feature = "opengl"))]
pub mod glx;

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub mod connection_poller;

/// Wrappers and utilities around the Win32 API
Expand Down
2 changes: 1 addition & 1 deletion src/x11/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fn code_to_key(code: Code, m: Modifiers) -> Key {
}
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
/// Map hardware keycode to code.
///
/// In theory, the hardware keycode is device dependent, but in
Expand Down
Loading