diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-12-11 03:40:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-11 00:40:32 +0000 |
commit | 6b208a6958a32594cf1248f5336f8a8f79d17fe3 (patch) | |
tree | 1e1269dd829e8cc6688eed8b60cafabc97108c0e /alacritty | |
parent | b0022047542de5979895ae0957e958b8cd5b6020 (diff) | |
download | r-alacritty-6b208a6958a32594cf1248f5336f8a8f79d17fe3.tar.gz r-alacritty-6b208a6958a32594cf1248f5336f8a8f79d17fe3.tar.bz2 r-alacritty-6b208a6958a32594cf1248f5336f8a8f79d17fe3.zip |
Bump glutin to 0.26.0
Fixes #4530.
Fixes #4072.
Fixes #1927.
Diffstat (limited to 'alacritty')
-rw-r--r-- | alacritty/Cargo.toml | 2 | ||||
-rw-r--r-- | alacritty/src/config/bindings.rs | 4 | ||||
-rw-r--r-- | alacritty/src/event.rs | 2 | ||||
-rw-r--r-- | alacritty/src/wayland_theme.rs | 4 | ||||
-rw-r--r-- | alacritty/src/window.rs | 21 |
5 files changed, 10 insertions, 23 deletions
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index 8de19196..a4f774b1 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -21,7 +21,7 @@ fnv = "1" serde = { version = "1", features = ["derive"] } serde_yaml = "0.8" serde_json = "1" -glutin = { version = "0.25.1", default-features = false, features = ["serde"] } +glutin = { version = "0.26.0", default-features = false, features = ["serde"] } notify = "4" parking_lot = "0.11.0" crossfont = { version = "0.1.0", features = ["force_system_fontconfig"] } diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index 62da0e6c..f5b63561 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -638,7 +638,7 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper { type Value = MouseButtonWrapper; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str("Left, Right, Middle, or a number from 0 to 255") + f.write_str("Left, Right, Middle, or a number from 0 to 65536") } fn visit_u64<E>(self, value: u64) -> Result<MouseButtonWrapper, E> @@ -646,7 +646,7 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper { E: de::Error, { match value { - 0..=255 => Ok(MouseButtonWrapper(MouseButton::Other(value as u8))), + 0..=65536 => Ok(MouseButtonWrapper(MouseButton::Other(value as u16))), _ => Err(E::invalid_value(Unexpected::Unsigned(value), &self)), } } diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 8ecf6f00..441cb21e 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -19,7 +19,7 @@ use std::time::{Duration, Instant}; use glutin::dpi::PhysicalSize; use glutin::event::{ElementState, Event as GlutinEvent, ModifiersState, MouseButton, WindowEvent}; use glutin::event_loop::{ControlFlow, EventLoop, EventLoopProxy, EventLoopWindowTarget}; -use glutin::platform::desktop::EventLoopExtDesktop; +use glutin::platform::run_return::EventLoopExtRunReturn; #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] use glutin::platform::unix::EventLoopWindowTargetExtUnix; use log::info; diff --git a/alacritty/src/wayland_theme.rs b/alacritty/src/wayland_theme.rs index c18044f9..b9c4381e 100644 --- a/alacritty/src/wayland_theme.rs +++ b/alacritty/src/wayland_theme.rs @@ -67,10 +67,6 @@ impl WaylandTheme for AlacrittyWaylandTheme { (_, Button::Close) => self.hovered_close_icon, } } - - fn font(&self) -> Option<(String, f32)> { - Some((String::from("sans-serif"), 17.)) - } } trait IntoARGBColor { diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs index 953fffd9..e43e5c95 100644 --- a/alacritty/src/window.rs +++ b/alacritty/src/window.rs @@ -27,10 +27,12 @@ use std::fmt::{self, Display, Formatter}; use glutin::dpi::{PhysicalPosition, PhysicalSize}; use glutin::event_loop::EventLoop; #[cfg(target_os = "macos")] -use glutin::platform::macos::{RequestUserAttentionType, WindowBuilderExtMacOS, WindowExtMacOS}; +use glutin::platform::macos::{WindowBuilderExtMacOS, WindowExtMacOS}; #[cfg(windows)] use glutin::platform::windows::IconExtWindows; -use glutin::window::{CursorIcon, Fullscreen, Window as GlutinWindow, WindowBuilder, WindowId}; +use glutin::window::{ + CursorIcon, Fullscreen, UserAttentionType, Window as GlutinWindow, WindowBuilder, WindowId, +}; use glutin::{self, ContextBuilder, PossiblyCurrent, WindowedContext}; #[cfg(windows)] use winapi::shared::minwindef::WORD; @@ -328,23 +330,12 @@ impl Window { } } - #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] - pub fn set_urgent(&self, is_urgent: bool) { - self.window().set_urgent(is_urgent); - } - - #[cfg(target_os = "macos")] pub fn set_urgent(&self, is_urgent: bool) { - if !is_urgent { - return; - } + let attention = if is_urgent { Some(UserAttentionType::Critical) } else { None }; - self.window().request_user_attention(RequestUserAttentionType::Critical); + self.window().request_user_attention(attention); } - #[cfg(any(windows, not(any(feature = "x11", target_os = "macos"))))] - pub fn set_urgent(&self, _is_urgent: bool) {} - pub fn set_outer_position(&self, pos: PhysicalPosition<i32>) { self.window().set_outer_position(pos); } |