Skip to content

Commit

Permalink
Update glutin to 0.30.0
Browse files Browse the repository at this point in the history
The glutin 0.30.0 update decouples glutin from winit which
provides us with basis for a multithreaded renderer. This
also improves robustness of our configuration picking,
context creation, and surface handling.

As an example we're now able to start on systems without a vsync,
we don't try to build lots of contexts to check if some config works,
and so on.

That also brings us possibility to handle context losses, but that's
a future work.

Fixes #1268.
  • Loading branch information
kchibisov committed Nov 3, 2022
1 parent 578e084 commit 0e418bc
Show file tree
Hide file tree
Showing 27 changed files with 774 additions and 622 deletions.
4 changes: 2 additions & 2 deletions .builds/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ tasks:
cargo test
- oldstable: |
cd alacritty
rustup toolchain install --profile minimal 1.57.0
rustup default 1.57.0
rustup toolchain install --profile minimal 1.60.0
rustup default 1.60.0
cargo test
- clippy: |
cd alacritty
Expand Down
4 changes: 2 additions & 2 deletions .builds/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ tasks:
cargo +nightly fmt -- --check
- oldstable: |
cd alacritty
rustup toolchain install --profile minimal 1.57.0
rustup default 1.57.0
rustup toolchain install --profile minimal 1.60.0
rustup default 1.60.0
cargo test
- clippy: |
cd alacritty
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: cargo test
- name: Oldstable
run: |
rustup default 1.57.0
rustup default 1.60.0
cargo test
- name: Clippy
run: |
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Packaging

- Minimum Rust version has been bumped to 1.60.0

## 0.11.0

### Packaging

- Minimum Rust version has been bumped to 1.57.0
- Renamed `io.alacritty.Alacritty.appdata.xml` to `org.alacritty.Alacritty.appdata.xml`
- Renamed `io.alacritty` to `org.alacritty` for `Alacritty.app`
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ and
[easy](https://github.com/alacritty/alacritty/issues?q=is%3Aopen+is%3Aissue+label%3A%22D+-+easy%22)
issues.

Please note that the minimum supported version of Alacritty is Rust 1.57.0. All patches are expected
Please note that the minimum supported version of Alacritty is Rust 1.60.0. All patches are expected
to work with the minimum supported version.

Since `alacritty_terminal`'s version always tracks the next release, make sure that the version is
Expand Down
93 changes: 35 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions alacritty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = "A fast, cross-platform, OpenGL terminal emulator"
readme = "README.md"
homepage = "https://github.com/alacritty/alacritty"
edition = "2021"
rust-version = "1.57.0"
rust-version = "1.60.0"

[dependencies.alacritty_terminal]
path = "../alacritty_terminal"
Expand All @@ -29,11 +29,13 @@ fnv = "1"
serde = { version = "1", features = ["derive"] }
serde_yaml = "0.8"
serde_json = "1"
glutin = { version = "0.29.1", default-features = false, features = ["serde"] }
glutin = { version = "0.30.0", default-features = false, features = ["egl", "wgl"] }
winit = { version = "0.27.4", default-features = false, features = ["serde"] }
notify = "4"
parking_lot = "0.12.0"
crossfont = { version = "0.5.0", features = ["force_system_fontconfig"] }
copypasta = { version = "0.8.1", default-features = false }
raw-window-handle = "0.5.0"
libc = "0.2"
unicode-width = "0.1"
bitflags = "1"
Expand Down Expand Up @@ -74,11 +76,18 @@ embed-resource = "1.7.2"

[features]
default = ["wayland", "x11"]
x11 = ["copypasta/x11", "glutin/x11", "x11-dl", "png"]
x11 = [
"copypasta/x11",
"winit/x11",
"glutin/x11",
"glutin/glx",
"x11-dl",
"png"]
wayland = [
"copypasta/wayland",
"glutin/wayland",
"glutin/wayland-dlopen",
"glutin/wayland-csd-adwaita",
"winit/wayland",
"winit/wayland-dlopen",
"winit/wayland-csd-adwaita",
"wayland-client"]
nightly = []
8 changes: 4 additions & 4 deletions alacritty/src/config/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use std::fmt::{self, Debug, Display};

use bitflags::bitflags;
use glutin::event::VirtualKeyCode::*;
use glutin::event::{ModifiersState, MouseButton, VirtualKeyCode};
use serde::de::{self, Error as SerdeError, MapAccess, Unexpected, Visitor};
use serde::{Deserialize, Deserializer};
use serde_yaml::Value as SerdeValue;
use winit::event::VirtualKeyCode::*;
use winit::event::{ModifiersState, MouseButton, VirtualKeyCode};

use alacritty_config_derive::{ConfigDeserialize, SerdeReplace};

Expand Down Expand Up @@ -1187,7 +1187,7 @@ impl<'a> Deserialize<'a> for KeyBinding {
}
}

/// Newtype for implementing deserialize on glutin Mods.
/// Newtype for implementing deserialize on winit Mods.
///
/// Our deserialize impl wouldn't be covered by a derive(Deserialize); see the
/// impl below.
Expand Down Expand Up @@ -1242,7 +1242,7 @@ impl<'a> de::Deserialize<'a> for ModsWrapper {
mod tests {
use super::*;

use glutin::event::ModifiersState;
use winit::event::ModifiersState;

type MockBinding = Binding<usize>;

Expand Down
2 changes: 1 addition & 1 deletion alacritty/src/config/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::path::PathBuf;
use std::sync::mpsc;
use std::time::Duration;

use glutin::event_loop::EventLoopProxy;
use log::{debug, error};
use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
use winit::event_loop::EventLoopProxy;

use alacritty_terminal::thread;

Expand Down
2 changes: 1 addition & 1 deletion alacritty/src/config/ui_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use std::fmt::{self, Formatter};
use std::path::PathBuf;
use std::rc::Rc;

use glutin::event::{ModifiersState, VirtualKeyCode};
use log::error;
use serde::de::{Error as SerdeError, MapAccess, Visitor};
use serde::{self, Deserialize, Deserializer};
use unicode_width::UnicodeWidthChar;
use winit::event::{ModifiersState, VirtualKeyCode};

use alacritty_config_derive::{ConfigDeserialize, SerdeReplace};
use alacritty_terminal::config::{
Expand Down
10 changes: 5 additions & 5 deletions alacritty/src/config/window.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::fmt::{self, Formatter};
use std::os::raw::c_ulong;

use glutin::window::Fullscreen;
use log::{error, warn};
use serde::de::{self, MapAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize};
use winit::window::Fullscreen;

use alacritty_config_derive::{ConfigDeserialize, SerdeReplace};
use alacritty_terminal::config::{Percentage, LOG_TARGET_CONFIG};
Expand Down Expand Up @@ -116,14 +116,14 @@ impl WindowConfig {
pub fn decorations_theme_variant(&self) -> Option<&str> {
self.gtk_theme_variant
.as_ref()
.or_else(|| self.decorations_theme_variant.as_ref())
.or(self.decorations_theme_variant.as_ref())
.map(|theme| theme.as_str())
}

#[inline]
pub fn padding(&self, scale_factor: f64) -> (f32, f32) {
let padding_x = (f32::from(self.padding.x) * scale_factor as f32).floor();
let padding_y = (f32::from(self.padding.y) * scale_factor as f32).floor();
pub fn padding(&self, scale_factor: f32) -> (f32, f32) {
let padding_x = (f32::from(self.padding.x) * scale_factor).floor();
let padding_y = (f32::from(self.padding.y) * scale_factor).floor();
(padding_x, padding_y)
}

Expand Down
Loading

0 comments on commit 0e418bc

Please sign in to comment.