mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Publish 0.8.1 with fixes necessary for glutin (#296)
This commit is contained in:
parent
6a2a7036d4
commit
15fbc0dff4
|
@ -1,5 +1,10 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
# Version 0.8.1 (2017-09-22)
|
||||||
|
|
||||||
|
- Added various methods to `os::linux::EventsLoopExt`, plus some hidden items necessary to make
|
||||||
|
glutin work.
|
||||||
|
|
||||||
# Version 0.8.0 (2017-09-21)
|
# Version 0.8.0 (2017-09-21)
|
||||||
|
|
||||||
- Added `Window::set_maximized`, `WindowAttributes::maximized` and `WindowBuilder::with_maximized`.
|
- Added `Window::set_maximized`, `WindowAttributes::maximized` and `WindowBuilder::with_maximized`.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "winit"
|
name = "winit"
|
||||||
version = "0.8.0"
|
version = "0.8.1"
|
||||||
authors = ["The winit contributors, Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
authors = ["The winit contributors, Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||||
description = "Cross-platform window creation library."
|
description = "Cross-platform window creation library."
|
||||||
keywords = ["windowing"]
|
keywords = ["windowing"]
|
||||||
|
|
|
@ -12,6 +12,10 @@ use WindowBuilder;
|
||||||
use platform::x11::XConnection;
|
use platform::x11::XConnection;
|
||||||
use platform::x11::ffi::XVisualInfo;
|
use platform::x11::ffi::XVisualInfo;
|
||||||
|
|
||||||
|
// TODO: stupid hack so that glutin can do its work
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use platform::x11;
|
||||||
|
|
||||||
pub use platform::XNotSupported;
|
pub use platform::XNotSupported;
|
||||||
|
|
||||||
/// Additional methods on `EventsLoop` that are specific to Linux.
|
/// Additional methods on `EventsLoop` that are specific to Linux.
|
||||||
|
@ -23,6 +27,15 @@ pub trait EventsLoopExt {
|
||||||
/// Builds a new `EventsLoop` that is forced to use Wayland.
|
/// Builds a new `EventsLoop` that is forced to use Wayland.
|
||||||
fn new_wayland() -> Self
|
fn new_wayland() -> Self
|
||||||
where Self: Sized;
|
where Self: Sized;
|
||||||
|
|
||||||
|
/// True if the `EventsLoop` uses Wayland.
|
||||||
|
fn is_wayland(&self) -> bool;
|
||||||
|
|
||||||
|
/// True if the `EventsLoop` uses X11.
|
||||||
|
fn is_x11(&self) -> bool;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
fn get_xlib_xconnection(&self) -> Option<Arc<XConnection>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EventsLoopExt for EventsLoop {
|
impl EventsLoopExt for EventsLoop {
|
||||||
|
@ -40,6 +53,21 @@ impl EventsLoopExt for EventsLoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn is_wayland(&self) -> bool {
|
||||||
|
self.events_loop.is_wayland()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn is_x11(&self) -> bool {
|
||||||
|
!self.events_loop.is_wayland()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn get_xlib_xconnection(&self) -> Option<Arc<XConnection>> {
|
||||||
|
self.events_loop.x_connection().cloned()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Additional methods on `Window` that are specific to Unix.
|
/// Additional methods on `Window` that are specific to Unix.
|
||||||
|
|
|
@ -382,6 +382,22 @@ impl EventsLoop {
|
||||||
EventsLoop::X(ref mut evlp) => evlp.run_forever(callback)
|
EventsLoop::X(ref mut evlp) => evlp.run_forever(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn is_wayland(&self) -> bool {
|
||||||
|
match *self {
|
||||||
|
EventsLoop::Wayland(_) => true,
|
||||||
|
EventsLoop::X(_) => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn x_connection(&self) -> Option<&Arc<XConnection>> {
|
||||||
|
match *self {
|
||||||
|
EventsLoop::Wayland(_) => None,
|
||||||
|
EventsLoop::X(ref ev) => Some(ev.x_connection()),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EventsLoopProxy {
|
impl EventsLoopProxy {
|
||||||
|
|
Loading…
Reference in a new issue