mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
* Fix compile errors * Use `mio` for the X11 event loop * Removes `calloop` from the X11 event loop, as the method of draining a source using a closure provided to the `calloop::EventLoop` instance conflicts with the need to deliver events directly to the callback provided to `EventLoop::run`, in order to respond to the value provided by `WindowEvent::HiDpiFactorChanged`. * Implement interactive `HiDpiFactorChanged` event for X11 * Implement interactive `HiDpiFactorChanged` event for Wayland * Run cargo fmt * Fix Wayland not processing events from EventQueue * Backport #981
39 lines
863 B
Rust
39 lines
863 B
Rust
#![cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd",
|
|
target_os = "netbsd", target_os = "openbsd"))]
|
|
|
|
pub use self::{
|
|
event_loop::{EventLoop, EventLoopProxy, EventLoopWindowTarget, MonitorHandle, VideoMode},
|
|
window::Window,
|
|
};
|
|
|
|
use smithay_client_toolkit::reexports::client::protocol::wl_surface;
|
|
|
|
mod event_loop;
|
|
mod keyboard;
|
|
mod pointer;
|
|
mod touch;
|
|
mod window;
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
|
pub struct DeviceId;
|
|
|
|
impl DeviceId {
|
|
pub unsafe fn dummy() -> Self {
|
|
DeviceId
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
|
pub struct WindowId(usize);
|
|
|
|
impl WindowId {
|
|
pub unsafe fn dummy() -> Self {
|
|
WindowId(0)
|
|
}
|
|
}
|
|
|
|
#[inline]
|
|
fn make_wid(s: &wl_surface::WlSurface) -> WindowId {
|
|
WindowId(s.as_ref().c_ptr() as usize)
|
|
}
|