1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-25 14:05:41 -05:00

Bump glutin to 0.29.1

Fixes #6239.
Fixes #5975.
Fixes #5876.
Fixes #5767.
Fixes #4484.
Fixes #3139.
This commit is contained in:
Kirill Chibisov 2022-08-10 16:48:46 +04:00 committed by GitHub
parent 76c5d01ee2
commit 7d708d53f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 331 additions and 182 deletions

View file

@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Config option `cursor.blink_timeout` to timeout cursor blinking after inactivity - Config option `cursor.blink_timeout` to timeout cursor blinking after inactivity
- Escape sequence to set hyperlinks (`OSC 8 ; params ; URI ST`) - Escape sequence to set hyperlinks (`OSC 8 ; params ; URI ST`)
- Config `hints.enabled.hyperlinks` for hyperlink escape sequence hint highlight - Config `hints.enabled.hyperlinks` for hyperlink escape sequence hint highlight
- `window.decorations_theme_variant` to control both Wayland CSD and GTK theme variant on X11
### Changed ### Changed
@ -36,6 +37,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Deprecated `colors.search.bar`, use `colors.footer_bar` instead - Deprecated `colors.search.bar`, use `colors.footer_bar` instead
- On macOS, Alacritty now reads `AppleFontSmoothing` from user defaults to control font smoothing - On macOS, Alacritty now reads `AppleFontSmoothing` from user defaults to control font smoothing
- Warn when either `columns` or `lines` is non-zero, but not both - Warn when either `columns` or `lines` is non-zero, but not both
- Client side decorations should have proper text rendering now on Wayland
- Config option `window.gtk_theme_variant`, you should use `window.decorations_theme_variant` instead
### Fixed ### Fixed
@ -55,6 +58,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- On macOS, `font.use_thin_strokes` did not work since Big Sur - On macOS, `font.use_thin_strokes` did not work since Big Sur
- On macOS, trying to load a disabled font would crash - On macOS, trying to load a disabled font would crash
- On macOS, Alacritty sessions did not appear in the list of tty sessions for `w` and `who` - On macOS, Alacritty sessions did not appear in the list of tty sessions for `w` and `who`
- Cursor not hiding on GNOME Wayland
- Font having different scale factor after monitor powering off/on on X11
- Viewport not updating after opening a new tabbed window on macOS
- Terminal not exiting sometimes after closing all windows on macOS
- CPU usage spikes due to mouse movements for unfocused windows on X11
- First window on macOS not tabbed with system prefer tabs setting
- Window being treaten as focused by default on Wayland
### Removed ### Removed

312
Cargo.lock generated
View file

@ -2,6 +2,12 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "adler"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]] [[package]]
name = "adler32" name = "adler32"
version = "1.2.0" version = "1.2.0"
@ -30,7 +36,7 @@ dependencies = [
"notify", "notify",
"objc", "objc",
"once_cell", "once_cell",
"parking_lot", "parking_lot 0.12.1",
"png", "png",
"raw-window-handle", "raw-window-handle",
"serde", "serde",
@ -69,8 +75,8 @@ dependencies = [
"mio-anonymous-pipes", "mio-anonymous-pipes",
"mio-extras", "mio-extras",
"miow 0.3.7", "miow 0.3.7",
"nix", "nix 0.24.1",
"parking_lot", "parking_lot 0.12.1",
"regex-automata", "regex-automata",
"serde", "serde",
"serde_json", "serde_json",
@ -83,10 +89,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "android_glue" name = "arrayref"
version = "0.2.3" version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]] [[package]]
name = "atty" name = "atty"
@ -130,13 +142,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
[[package]] [[package]]
name = "calloop" name = "bytemuck"
version = "0.9.3" version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc"
[[package]]
name = "calloop"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a22a6a8f622f797120d452c630b0ab12e1331a1a753e2039ce7868d4ac77b4ee"
dependencies = [ dependencies = [
"log", "log",
"nix", "nix 0.24.1",
"slotmap",
"thiserror",
"vec_map",
] ]
[[package]] [[package]]
@ -242,8 +263,8 @@ dependencies = [
"bitflags", "bitflags",
"block", "block",
"cocoa-foundation", "cocoa-foundation",
"core-foundation 0.9.3", "core-foundation",
"core-graphics 0.22.3", "core-graphics",
"foreign-types 0.3.2", "foreign-types 0.3.2",
"libc", "libc",
"objc", "objc",
@ -257,7 +278,7 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"block", "block",
"core-foundation 0.9.3", "core-foundation",
"core-graphics-types", "core-graphics-types",
"foreign-types 0.3.2", "foreign-types 0.3.2",
"libc", "libc",
@ -278,50 +299,22 @@ dependencies = [
"x11-clipboard", "x11-clipboard",
] ]
[[package]]
name = "core-foundation"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.3" version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
dependencies = [ dependencies = [
"core-foundation-sys 0.8.3", "core-foundation-sys",
"libc", "libc",
] ]
[[package]]
name = "core-foundation-sys"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]] [[package]]
name = "core-foundation-sys" name = "core-foundation-sys"
version = "0.8.3" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]]
name = "core-graphics"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
dependencies = [
"bitflags",
"core-foundation 0.7.0",
"foreign-types 0.3.2",
"libc",
]
[[package]] [[package]]
name = "core-graphics" name = "core-graphics"
version = "0.22.3" version = "0.22.3"
@ -329,7 +322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation 0.9.3", "core-foundation",
"core-graphics-types", "core-graphics-types",
"foreign-types 0.3.2", "foreign-types 0.3.2",
"libc", "libc",
@ -342,7 +335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation 0.9.3", "core-foundation",
"foreign-types 0.3.2", "foreign-types 0.3.2",
"libc", "libc",
] ]
@ -353,25 +346,12 @@ version = "19.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25"
dependencies = [ dependencies = [
"core-foundation 0.9.3", "core-foundation",
"core-graphics 0.22.3", "core-graphics",
"foreign-types 0.3.2", "foreign-types 0.3.2",
"libc", "libc",
] ]
[[package]]
name = "core-video-sys"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828"
dependencies = [
"cfg-if 0.1.10",
"core-foundation-sys 0.7.0",
"core-graphics 0.19.2",
"libc",
"objc",
]
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
version = "1.3.2" version = "1.3.2"
@ -388,9 +368,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f66b1c1979c4362323f03ab6bf7fb522902bfc418e0c37319ab347f9561d980f" checksum = "f66b1c1979c4362323f03ab6bf7fb522902bfc418e0c37319ab347f9561d980f"
dependencies = [ dependencies = [
"cocoa", "cocoa",
"core-foundation 0.9.3", "core-foundation",
"core-foundation-sys 0.8.3", "core-foundation-sys",
"core-graphics 0.22.3", "core-graphics",
"core-text", "core-text",
"dwrote", "dwrote",
"foreign-types 0.5.0", "foreign-types 0.5.0",
@ -445,6 +425,15 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "deflate"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f"
dependencies = [
"adler32",
]
[[package]] [[package]]
name = "dirs" name = "dirs"
version = "4.0.0" version = "4.0.0"
@ -664,25 +653,24 @@ dependencies = [
[[package]] [[package]]
name = "glutin" name = "glutin"
version = "0.28.0" version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00ea9dbe544bc8a657c4c4a798c2d16cd01b549820e47657297549d28371f6d2" checksum = "444c9ad294fdcaf20ccf6726b78f380b5450275540c9b68ab62f49726ad1c713"
dependencies = [ dependencies = [
"android_glue",
"cgl", "cgl",
"cocoa", "cocoa",
"core-foundation 0.9.3", "core-foundation",
"glutin_egl_sys", "glutin_egl_sys",
"glutin_emscripten_sys",
"glutin_gles2_sys", "glutin_gles2_sys",
"glutin_glx_sys", "glutin_glx_sys",
"glutin_wgl_sys", "glutin_wgl_sys",
"lazy_static",
"libloading", "libloading",
"log", "log",
"objc", "objc",
"once_cell",
"osmesa-sys", "osmesa-sys",
"parking_lot", "parking_lot 0.12.1",
"raw-window-handle",
"wayland-client", "wayland-client",
"wayland-egl", "wayland-egl",
"winapi 0.3.9", "winapi 0.3.9",
@ -691,20 +679,14 @@ dependencies = [
[[package]] [[package]]
name = "glutin_egl_sys" name = "glutin_egl_sys"
version = "0.1.5" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" checksum = "68900f84b471f31ea1d1355567eb865a2cf446294f06cef8d653ed7bcf5f013d"
dependencies = [ dependencies = [
"gl_generator", "gl_generator",
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "glutin_emscripten_sys"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1"
[[package]] [[package]]
name = "glutin_gles2_sys" name = "glutin_gles2_sys"
version = "0.1.5" version = "0.1.5"
@ -717,9 +699,9 @@ dependencies = [
[[package]] [[package]]
name = "glutin_glx_sys" name = "glutin_glx_sys"
version = "0.1.7" version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" checksum = "d93d0575865098580c5b3a423188cd959419912ea60b1e48e8b3b526f6d02468"
dependencies = [ dependencies = [
"gl_generator", "gl_generator",
"x11-dl", "x11-dl",
@ -736,9 +718,9 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.12.1" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]] [[package]]
name = "heck" name = "heck"
@ -763,9 +745,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "1.9.0" version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c6392766afd7964e2531940894cffe4bd8d7d17dbc3c1c4857040fd4b33bdb3" checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown", "hashbrown",
@ -926,9 +908,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]] [[package]]
name = "memmap2" name = "memmap2"
version = "0.3.1" version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" checksum = "d5172b50c23043ff43dd53e51392f36519d9b35a8f3a410d30ece5d1aedd58ae"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -950,11 +932,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.3.7" version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
dependencies = [ dependencies = [
"adler32", "adler",
] ]
[[package]] [[package]]
@ -996,7 +978,7 @@ checksum = "6bc513025fe5005a3aa561b50fdb2cda5a150b84800ae02acd8aa9ed62ca1a6b"
dependencies = [ dependencies = [
"mio 0.6.23", "mio 0.6.23",
"miow 0.3.7", "miow 0.3.7",
"parking_lot", "parking_lot 0.11.2",
"spsc-buffer", "spsc-buffer",
"winapi 0.3.9", "winapi 0.3.9",
] ]
@ -1047,14 +1029,15 @@ dependencies = [
[[package]] [[package]]
name = "ndk" name = "ndk"
version = "0.5.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"jni-sys", "jni-sys",
"ndk-sys", "ndk-sys",
"num_enum", "num_enum",
"raw-window-handle",
"thiserror", "thiserror",
] ]
@ -1066,17 +1049,18 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
[[package]] [[package]]
name = "ndk-glue" name = "ndk-glue"
version = "0.5.2" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f"
dependencies = [ dependencies = [
"lazy_static",
"libc", "libc",
"log", "log",
"ndk", "ndk",
"ndk-context", "ndk-context",
"ndk-macro", "ndk-macro",
"ndk-sys", "ndk-sys",
"once_cell",
"parking_lot 0.12.1",
] ]
[[package]] [[package]]
@ -1094,9 +1078,12 @@ dependencies = [
[[package]] [[package]]
name = "ndk-sys" name = "ndk-sys"
version = "0.2.2" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046"
dependencies = [
"jni-sys",
]
[[package]] [[package]]
name = "net2" name = "net2"
@ -1122,6 +1109,18 @@ dependencies = [
"memoffset", "memoffset",
] ]
[[package]]
name = "nix"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"
dependencies = [
"bitflags",
"cfg-if 1.0.0",
"libc",
"memoffset",
]
[[package]] [[package]]
name = "nom" name = "nom"
version = "7.1.1" version = "7.1.1"
@ -1202,9 +1201,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.12.0" version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]] [[package]]
name = "os_str_bytes" name = "os_str_bytes"
@ -1229,7 +1228,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
dependencies = [ dependencies = [
"instant", "instant",
"lock_api", "lock_api",
"parking_lot_core", "parking_lot_core 0.8.5",
]
[[package]]
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core 0.9.3",
] ]
[[package]] [[package]]
@ -1246,6 +1255,19 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "parking_lot_core"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
dependencies = [
"cfg-if 1.0.0",
"libc",
"redox_syscall",
"smallvec",
"windows-sys",
]
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.1.0" version = "2.1.0"
@ -1260,12 +1282,13 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]] [[package]]
name = "png" name = "png"
version = "0.16.8" version = "0.17.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"crc32fast", "crc32fast",
"deflate",
"miniz_oxide", "miniz_oxide",
] ]
@ -1332,9 +1355,9 @@ dependencies = [
[[package]] [[package]]
name = "raw-window-handle" name = "raw-window-handle"
version = "0.4.3" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a"
dependencies = [ dependencies = [
"cty", "cty",
] ]
@ -1389,6 +1412,15 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
[[package]]
name = "safe_arch"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05"
dependencies = [
"bytemuck",
]
[[package]] [[package]]
name = "same-file" name = "same-file"
version = "1.0.6" version = "1.0.6"
@ -1410,6 +1442,18 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "sctk-adwaita"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8cdeb3fbbd384de045d5683bfc3cadfc4c6ed1e6471f201ede801f31571581a"
dependencies = [
"crossfont",
"log",
"smithay-client-toolkit",
"tiny-skia",
]
[[package]] [[package]]
name = "semver" name = "semver"
version = "1.0.10" version = "1.0.10"
@ -1527,6 +1571,15 @@ version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32"
[[package]]
name = "slotmap"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342"
dependencies = [
"version_check",
]
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.8.0" version = "1.8.0"
@ -1535,9 +1588,9 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
[[package]] [[package]]
name = "smithay-client-toolkit" name = "smithay-client-toolkit"
version = "0.15.4" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"calloop", "calloop",
@ -1545,7 +1598,7 @@ dependencies = [
"lazy_static", "lazy_static",
"log", "log",
"memmap2", "memmap2",
"nix", "nix 0.24.1",
"pkg-config", "pkg-config",
"wayland-client", "wayland-client",
"wayland-cursor", "wayland-cursor",
@ -1554,9 +1607,9 @@ dependencies = [
[[package]] [[package]]
name = "smithay-clipboard" name = "smithay-clipboard"
version = "0.6.5" version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8"
dependencies = [ dependencies = [
"smithay-client-toolkit", "smithay-client-toolkit",
"wayland-client", "wayland-client",
@ -1620,6 +1673,20 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "tiny-skia"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3e1db967020dd509b49cecc024025beba2b1b6cf204618610ba266269d6b9"
dependencies = [
"arrayref",
"arrayvec",
"bytemuck",
"cfg-if 1.0.0",
"png",
"safe_arch",
]
[[package]] [[package]]
name = "toml" name = "toml"
version = "0.5.9" version = "0.5.9"
@ -1647,6 +1714,12 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.4" version = "0.9.4"
@ -1773,7 +1846,7 @@ dependencies = [
"bitflags", "bitflags",
"downcast-rs", "downcast-rs",
"libc", "libc",
"nix", "nix 0.22.3",
"scoped-tls", "scoped-tls",
"wayland-commons", "wayland-commons",
"wayland-scanner", "wayland-scanner",
@ -1786,7 +1859,7 @@ version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e"
dependencies = [ dependencies = [
"nix", "nix 0.22.3",
"once_cell", "once_cell",
"smallvec", "smallvec",
"wayland-sys", "wayland-sys",
@ -1798,7 +1871,7 @@ version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd"
dependencies = [ dependencies = [
"nix", "nix 0.22.3",
"wayland-client", "wayland-client",
"xcursor", "xcursor",
] ]
@ -1945,35 +2018,34 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]] [[package]]
name = "winit" name = "winit"
version = "0.26.1" version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" checksum = "b9b91360f15eb89d0bfee05d3c5981408320fe709f84953d3d90b276fc5962c7"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cocoa", "cocoa",
"core-foundation 0.9.3", "core-foundation",
"core-graphics 0.22.3", "core-graphics",
"core-video-sys",
"dispatch", "dispatch",
"instant", "instant",
"lazy_static",
"libc", "libc",
"log", "log",
"mio 0.8.3", "mio 0.8.3",
"ndk", "ndk",
"ndk-glue", "ndk-glue",
"ndk-sys",
"objc", "objc",
"parking_lot", "once_cell",
"parking_lot 0.12.1",
"percent-encoding", "percent-encoding",
"raw-window-handle", "raw-window-handle",
"sctk-adwaita",
"serde", "serde",
"smithay-client-toolkit", "smithay-client-toolkit",
"wasm-bindgen", "wasm-bindgen",
"wayland-client", "wayland-client",
"wayland-protocols", "wayland-protocols",
"web-sys", "web-sys",
"winapi 0.3.9", "windows-sys",
"x11-dl", "x11-dl",
] ]

View file

@ -94,11 +94,12 @@
# General application class # General application class
#general: Alacritty #general: Alacritty
# GTK theme variant (Linux/BSD only) # Decorations theme variant (Linux/BSD only)
# #
# Override the variant of the GTK theme. Commonly supported values are `dark` # Override the variant of the GTK theme/Wayland client side decorations.
# and `light`. Set this to `None` to use the default theme variant. # Commonly supported values are `dark` and `light`. Set this to `None` to use
#gtk_theme_variant: None # the default theme variant.
#decorations_theme_variant: None
#scrolling: #scrolling:
# Maximum number of lines in the scrollback buffer. # Maximum number of lines in the scrollback buffer.

View file

@ -25,11 +25,11 @@ fnv = "1"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_yaml = "0.8" serde_yaml = "0.8"
serde_json = "1" serde_json = "1"
glutin = { version = "0.28.0", default-features = false, features = ["serde"] } glutin = { version = "0.29.1", default-features = false, features = ["serde"] }
notify = "4" notify = "4"
parking_lot = "0.11.0" parking_lot = "0.12.0"
crossfont = { version = "0.5.0", features = ["force_system_fontconfig"] } crossfont = { version = "0.5.0", features = ["force_system_fontconfig"] }
copypasta = { version = "0.8.0", default-features = false } copypasta = { version = "0.8.1", default-features = false }
libc = "0.2" libc = "0.2"
unicode-width = "0.1" unicode-width = "0.1"
bitflags = "1" bitflags = "1"
@ -46,10 +46,10 @@ clap_complete = "3.0.0"
xdg = "2.4.0" xdg = "2.4.0"
[target.'cfg(not(target_os = "macos"))'.dependencies] [target.'cfg(not(target_os = "macos"))'.dependencies]
png = { version = "0.16.8", default-features = false, optional = true } png = { version = "0.17.5", default-features = false, optional = true }
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
raw-window-handle = "0.4.0" raw-window-handle = "0.5.0"
cocoa = "0.24.0" cocoa = "0.24.0"
objc = "0.2.2" objc = "0.2.2"
@ -61,10 +61,15 @@ wayland-client = { version = "0.29.0", features = ["dlopen"], optional = true }
winapi = { version = "0.3.7", features = ["impl-default", "wincon"]} winapi = { version = "0.3.7", features = ["impl-default", "wincon"]}
[target.'cfg(windows)'.build-dependencies] [target.'cfg(windows)'.build-dependencies]
embed-resource = "1.3" embed-resource = "1.7.2"
[features] [features]
default = ["wayland", "x11"] default = ["wayland", "x11"]
x11 = ["copypasta/x11", "glutin/x11", "x11-dl", "png"] x11 = ["copypasta/x11", "glutin/x11", "x11-dl", "png"]
wayland = ["copypasta/wayland", "glutin/wayland", "glutin/wayland-dlopen", "wayland-client"] wayland = [
"copypasta/wayland",
"glutin/wayland",
"glutin/wayland-dlopen",
"glutin/wayland-csd-adwaita",
"wayland-client"]
nightly = [] nightly = []

View file

@ -20,7 +20,7 @@ fn main() {
.unwrap(); .unwrap();
#[cfg(windows)] #[cfg(windows)]
embed_resource::compile("./windows/windows.rc"); embed_resource::compile("./windows/alacritty.rc");
} }
fn commit_hash() -> Option<String> { fn commit_hash() -> Option<String> {

View file

@ -31,7 +31,13 @@ pub struct WindowConfig {
pub embed: Option<c_ulong>, pub embed: Option<c_ulong>,
/// GTK theme variant. /// GTK theme variant.
pub gtk_theme_variant: Option<String>, #[config(deprecated = "use window.decorations_theme_variant instead")]
gtk_theme_variant: Option<String>,
/// System decorations theme variant.
///
/// Controls GTK theme variant on X11 and winit client side decorations on Wayland.
decorations_theme_variant: Option<String>,
/// Spread out additional padding evenly. /// Spread out additional padding evenly.
pub dynamic_padding: bool, pub dynamic_padding: bool,
@ -61,6 +67,7 @@ impl Default for WindowConfig {
decorations: Default::default(), decorations: Default::default(),
startup_mode: Default::default(), startup_mode: Default::default(),
embed: Default::default(), embed: Default::default(),
decorations_theme_variant: Default::default(),
gtk_theme_variant: Default::default(), gtk_theme_variant: Default::default(),
dynamic_padding: Default::default(), dynamic_padding: Default::default(),
identity: Identity::default(), identity: Identity::default(),
@ -104,6 +111,15 @@ impl WindowConfig {
} }
} }
#[cfg(not(any(target_os = "macos", windows)))]
#[inline]
pub fn decorations_theme_variant(&self) -> Option<&str> {
self.gtk_theme_variant
.as_ref()
.or_else(|| self.decorations_theme_variant.as_ref())
.map(|theme| theme.as_str())
}
#[inline] #[inline]
pub fn padding(&self, scale_factor: f64) -> (f32, f32) { pub fn padding(&self, scale_factor: f64) -> (f32, f32) {
let padding_x = (f32::from(self.padding.x) * scale_factor as f32).floor(); let padding_x = (f32::from(self.padding.x) * scale_factor as f32).floor();

View file

@ -13,6 +13,7 @@ use {
wayland_client::protocol::wl_surface::WlSurface, wayland_client::protocol::wl_surface::WlSurface,
wayland_client::{Attached, EventQueue, Proxy}, wayland_client::{Attached, EventQueue, Proxy},
glutin::platform::unix::EventLoopWindowTargetExtUnix, glutin::platform::unix::EventLoopWindowTargetExtUnix,
glutin::window::Theme,
}; };
#[rustfmt::skip] #[rustfmt::skip]
@ -60,7 +61,7 @@ use crate::gl;
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
static WINDOW_ICON: &[u8] = include_bytes!("../../alacritty.png"); static WINDOW_ICON: &[u8] = include_bytes!("../../alacritty.png");
/// This should match the definition of IDI_ICON from `windows.rc`. /// This should match the definition of IDI_ICON from `alacritty.rc`.
#[cfg(windows)] #[cfg(windows)]
const IDI_ICON: WORD = 0x101; const IDI_ICON: WORD = 0x101;
@ -233,6 +234,9 @@ impl Window {
let current_mouse_cursor = CursorIcon::Text; let current_mouse_cursor = CursorIcon::Text;
windowed_context.window().set_cursor_icon(current_mouse_cursor); windowed_context.window().set_cursor_icon(current_mouse_cursor);
// Enable IME.
windowed_context.window().set_ime_allowed(true);
// Set OpenGL symbol loader. This call MUST be after window.make_current on windows. // Set OpenGL symbol loader. This call MUST be after window.make_current on windows.
gl::load_with(|symbol| windowed_context.get_proc_address(symbol) as *const _); gl::load_with(|symbol| windowed_context.get_proc_address(symbol) as *const _);
@ -323,14 +327,15 @@ impl Window {
#[cfg(feature = "x11")] #[cfg(feature = "x11")]
let icon = { let icon = {
let decoder = Decoder::new(Cursor::new(WINDOW_ICON)); let decoder = Decoder::new(Cursor::new(WINDOW_ICON));
let (info, mut reader) = decoder.read_info().expect("invalid embedded icon"); let mut reader = decoder.read_info().expect("invalid embedded icon");
let mut buf = vec![0; info.buffer_size()]; let mut buf = vec![0; reader.output_buffer_size()];
let _ = reader.next_frame(&mut buf); let _ = reader.next_frame(&mut buf);
Icon::from_rgba(buf, info.width, info.height) Icon::from_rgba(buf, reader.info().width, reader.info().height)
}; };
let builder = WindowBuilder::new() let builder = WindowBuilder::new()
.with_title(&identity.title) .with_title(&identity.title)
.with_name(&identity.class.instance, &identity.class.general)
.with_visible(false) .with_visible(false)
.with_transparent(true) .with_transparent(true)
.with_decorations(window_config.decorations != Decorations::None) .with_decorations(window_config.decorations != Decorations::None)
@ -340,19 +345,19 @@ impl Window {
#[cfg(feature = "x11")] #[cfg(feature = "x11")]
let builder = builder.with_window_icon(icon.ok()); let builder = builder.with_window_icon(icon.ok());
#[cfg(feature = "wayland")]
let builder = builder.with_app_id(identity.class.instance.to_owned());
#[cfg(feature = "x11")] #[cfg(feature = "x11")]
let builder = builder let builder = match window_config.decorations_theme_variant() {
.with_class(identity.class.instance.to_owned(), identity.class.general.to_owned()); Some(val) => builder.with_gtk_theme_variant(val.to_string()),
#[cfg(feature = "x11")]
let builder = match &window_config.gtk_theme_variant {
Some(val) => builder.with_gtk_theme_variant(val.clone()),
None => builder, None => builder,
}; };
#[cfg(feature = "wayland")]
let builder = match window_config.decorations_theme_variant() {
Some("light") => builder.with_wayland_csd_theme(Theme::Light),
// Prefer dark theme by default, since default alacritty theme is dark.
_ => builder.with_wayland_csd_theme(Theme::Dark),
};
builder builder
} }

View file

@ -13,8 +13,12 @@ use std::time::{Duration, Instant};
use std::{env, f32, mem}; use std::{env, f32, mem};
use glutin::dpi::PhysicalSize; use glutin::dpi::PhysicalSize;
use glutin::event::{ElementState, Event as GlutinEvent, ModifiersState, MouseButton, WindowEvent}; use glutin::event::{
use glutin::event_loop::{ControlFlow, EventLoop, EventLoopProxy, EventLoopWindowTarget}; ElementState, Event as GlutinEvent, Ime, ModifiersState, MouseButton, StartCause, WindowEvent,
};
use glutin::event_loop::{
ControlFlow, DeviceEventFilter, EventLoop, EventLoopProxy, EventLoopWindowTarget,
};
use glutin::platform::run_return::EventLoopExtRunReturn; use glutin::platform::run_return::EventLoopExtRunReturn;
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
use glutin::platform::unix::EventLoopWindowTargetExtUnix; use glutin::platform::unix::EventLoopWindowTargetExtUnix;
@ -1208,6 +1212,13 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
*self.ctx.dirty = true; *self.ctx.dirty = true;
} }
}, },
WindowEvent::Ime(ime) => {
if let Ime::Commit(text) = ime {
for ch in text.chars() {
self.received_char(ch)
}
}
},
WindowEvent::KeyboardInput { is_synthetic: true, .. } WindowEvent::KeyboardInput { is_synthetic: true, .. }
| WindowEvent::TouchpadPressure { .. } | WindowEvent::TouchpadPressure { .. }
| WindowEvent::ScaleFactorChanged { .. } | WindowEvent::ScaleFactorChanged { .. }
@ -1218,6 +1229,7 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
| WindowEvent::ThemeChanged(_) | WindowEvent::ThemeChanged(_)
| WindowEvent::HoveredFile(_) | WindowEvent::HoveredFile(_)
| WindowEvent::Touch(_) | WindowEvent::Touch(_)
| WindowEvent::Occluded(_)
| WindowEvent::Moved(_) => (), | WindowEvent::Moved(_) => (),
} }
}, },
@ -1289,9 +1301,16 @@ impl Processor {
} }
/// Run the event loop. /// Run the event loop.
pub fn run(&mut self, mut event_loop: EventLoop<Event>) { ///
/// The result is exit code generate from the loop.
pub fn run(
&mut self,
mut event_loop: EventLoop<Event>,
initial_window_options: WindowOptions,
) -> Result<(), Box<dyn Error>> {
let proxy = event_loop.create_proxy(); let proxy = event_loop.create_proxy();
let mut scheduler = Scheduler::new(proxy.clone()); let mut scheduler = Scheduler::new(proxy.clone());
let mut initial_window_options = Some(initial_window_options);
// NOTE: Since this takes a pointer to the winit event loop, it MUST be dropped first. // NOTE: Since this takes a pointer to the winit event loop, it MUST be dropped first.
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
@ -1299,7 +1318,10 @@ impl Processor {
#[cfg(any(not(feature = "wayland"), target_os = "macos", windows))] #[cfg(any(not(feature = "wayland"), target_os = "macos", windows))]
let mut clipboard = Clipboard::new(); let mut clipboard = Clipboard::new();
event_loop.run_return(|event, event_loop, control_flow| { // Disable all device events, since we don't care about them.
event_loop.set_device_event_filter(DeviceEventFilter::Always);
let exit_code = event_loop.run_return(move |event, event_loop, control_flow| {
if self.config.debug.print_events { if self.config.debug.print_events {
info!("glutin event: {:?}", event); info!("glutin event: {:?}", event);
} }
@ -1310,6 +1332,27 @@ impl Processor {
} }
match event { match event {
// The event loop just got initialized. Create a window.
GlutinEvent::Resumed => {
// Creating window inside event loop is required for platforms like macOS to
// properly initialize state, like tab management. Othwerwise the first window
// won't handle tabs.
let initial_window_options = match initial_window_options.take() {
Some(initial_window_options) => initial_window_options,
None => return,
};
if let Err(err) =
self.create_window(event_loop, proxy.clone(), initial_window_options)
{
// Log the error right away since we can't return it.
eprintln!("Error: {}", err);
*control_flow = ControlFlow::ExitWithCode(1);
return;
}
info!("Initialisation complete");
},
// Check for shutdown. // Check for shutdown.
GlutinEvent::UserEvent(Event { GlutinEvent::UserEvent(Event {
window_id: Some(window_id), window_id: Some(window_id),
@ -1428,11 +1471,18 @@ impl Processor {
_ => (), _ => (),
} }
}); });
if exit_code == 0 {
Ok(())
} else {
Err(format!("Event loop terminated with code: {}", exit_code).into())
}
} }
/// Check if an event is irrelevant and can be skipped. /// Check if an event is irrelevant and can be skipped.
fn skip_event(event: &GlutinEvent<'_, Event>) -> bool { fn skip_event(event: &GlutinEvent<'_, Event>) -> bool {
match event { match event {
GlutinEvent::NewEvents(StartCause::Init) => false,
GlutinEvent::WindowEvent { event, .. } => matches!( GlutinEvent::WindowEvent { event, .. } => matches!(
event, event,
WindowEvent::KeyboardInput { is_synthetic: true, .. } WindowEvent::KeyboardInput { is_synthetic: true, .. }

View file

@ -14,13 +14,13 @@ compile_error!(r#"at least one of the "x11"/"wayland" features must be enabled"#
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use std::env; use std::env;
use std::error::Error;
use std::fmt::Write as _; use std::fmt::Write as _;
use std::fs;
use std::io::{self, Write}; use std::io::{self, Write};
use std::path::PathBuf; use std::path::PathBuf;
use std::string::ToString;
use std::{fs, process};
use glutin::event_loop::EventLoop as GlutinEventLoop; use glutin::event_loop::EventLoopBuilder as GlutinEventLoopBuilder;
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
use glutin::platform::unix::EventLoopWindowTargetExtUnix; use glutin::platform::unix::EventLoopWindowTargetExtUnix;
use log::info; use log::info;
@ -62,7 +62,7 @@ use crate::event::{Event, Processor};
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use crate::macos::locale; use crate::macos::locale;
fn main() { fn main() -> Result<(), Box<dyn Error>> {
#[cfg(windows)] #[cfg(windows)]
panic::attach_handler(); panic::attach_handler();
@ -78,25 +78,19 @@ fn main() {
let options = Options::new(); let options = Options::new();
#[cfg(unix)] #[cfg(unix)]
let result = match options.subcommands { match options.subcommands {
Some(Subcommands::Msg(options)) => msg(options), Some(Subcommands::Msg(options)) => msg(options),
None => alacritty(options), None => alacritty(options),
}; }
#[cfg(not(unix))] #[cfg(not(unix))]
let result = alacritty(options); alacritty(options)
// Handle command failure.
if let Err(err) = result {
eprintln!("Error: {}", err);
process::exit(1);
}
} }
/// `msg` subcommand entrypoint. /// `msg` subcommand entrypoint.
#[cfg(unix)] #[cfg(unix)]
fn msg(options: MessageOptions) -> Result<(), String> { fn msg(options: MessageOptions) -> Result<(), Box<dyn Error>> {
ipc::send_message(options.socket, options.message).map_err(|err| err.to_string()) ipc::send_message(options.socket, options.message).map_err(|err| err.into())
} }
/// Temporary files stored for Alacritty. /// Temporary files stored for Alacritty.
@ -129,9 +123,9 @@ impl Drop for TemporaryFiles {
/// ///
/// Creates a window, the terminal state, PTY, I/O event loop, input processor, /// Creates a window, the terminal state, PTY, I/O event loop, input processor,
/// config change monitor, and runs the main display loop. /// config change monitor, and runs the main display loop.
fn alacritty(options: Options) -> Result<(), String> { fn alacritty(options: Options) -> Result<(), Box<dyn Error>> {
// Setup glutin event loop. // Setup glutin event loop.
let window_event_loop = GlutinEventLoop::<Event>::with_user_event(); let window_event_loop = GlutinEventLoopBuilder::<Event>::with_user_event().build();
// Initialize the logger as soon as possible as to capture output from other subsystems. // Initialize the logger as soon as possible as to capture output from other subsystems.
let log_file = logging::initialize(&options, window_event_loop.create_proxy()) let log_file = logging::initialize(&options, window_event_loop.create_proxy())
@ -191,16 +185,8 @@ fn alacritty(options: Options) -> Result<(), String> {
let window_options = options.window_options.clone(); let window_options = options.window_options.clone();
let mut processor = Processor::new(config, options, &window_event_loop); let mut processor = Processor::new(config, options, &window_event_loop);
// Create the first Alacritty window.
let proxy = window_event_loop.create_proxy();
processor
.create_window(&window_event_loop, proxy, window_options)
.map_err(|err| err.to_string())?;
info!("Initialisation complete");
// Start event loop and block until shutdown. // Start event loop and block until shutdown.
processor.run(window_event_loop); let result = processor.run(window_event_loop, window_options);
// This explicit drop is needed for Windows, ConPTY backend. Otherwise a deadlock can occur. // This explicit drop is needed for Windows, ConPTY backend. Otherwise a deadlock can occur.
// The cause: // The cause:
@ -225,7 +211,8 @@ fn alacritty(options: Options) -> Result<(), String> {
} }
info!("Goodbye"); info!("Goodbye");
Ok(())
result
} }
fn log_config_path(config: &UiConfig) { fn log_config_path(config: &UiConfig) {

View file

@ -90,8 +90,8 @@ fn box_drawing(character: char, metrics: &Metrics, offset: &Delta<i8>) -> Raster
left: 0, left: 0,
height: height as i32, height: height as i32,
width: width as i32, width: width as i32,
advance: (0, 0),
buffer, buffer,
advance: (width as i32, height as i32),
}; };
}, },
_ => Canvas::new(width, height), _ => Canvas::new(width, height),
@ -486,8 +486,8 @@ fn box_drawing(character: char, metrics: &Metrics, offset: &Delta<i8>) -> Raster
left: 0, left: 0,
height: height as i32, height: height as i32,
width: width as i32, width: width as i32,
advance: (0, 0),
buffer, buffer,
advance: (width as i32, height as i32),
} }
} }

View file

@ -1,3 +1,6 @@
#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use)]
#![cfg_attr(feature = "cargo-clippy", deny(warnings))]
use proc_macro::TokenStream; use proc_macro::TokenStream;
use syn::{parse_macro_input, Data, DataStruct, DeriveInput, Error, Fields, Path}; use syn::{parse_macro_input, Data, DataStruct, DeriveInput, Error, Fields, Path};

View file

@ -105,7 +105,7 @@ fn config_deserialize() {
assert_eq!(test.enom_small, TestEnum::One); assert_eq!(test.enom_small, TestEnum::One);
assert_eq!(test.enom_big, TestEnum::Three); assert_eq!(test.enom_big, TestEnum::Three);
assert_eq!(test.enom_error, Test::default().enom_error); assert_eq!(test.enom_error, Test::default().enom_error);
assert_eq!(test.gone, false); assert!(!test.gone);
assert_eq!(test.nesting.field1, Test::default().nesting.field1); assert_eq!(test.nesting.field1, Test::default().nesting.field1);
assert_eq!(test.nesting.field2, None); assert_eq!(test.nesting.field2, None);
assert_eq!(test.nesting.field3, Test::default().nesting.field3); assert_eq!(test.nesting.field3, Test::default().nesting.field3);

View file

@ -16,7 +16,7 @@ version = "0.1.0"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
bitflags = "1" bitflags = "1"
parking_lot = "0.11.0" parking_lot = "0.12.0"
serde = { version = "1", features = ["derive", "rc"] } serde = { version = "1", features = ["derive", "rc"] }
serde_yaml = "0.8" serde_yaml = "0.8"
vte = { version = "0.10.0", default-features = false } vte = { version = "0.10.0", default-features = false }
@ -29,7 +29,7 @@ regex-automata = "0.1.9"
dirs = "4.0.0" dirs = "4.0.0"
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
nix = "0.22.0" nix = "0.24.1"
signal-hook = "0.3.10" signal-hook = "0.3.10"
signal-hook-mio = { version = "0.2.1", features = ["support-v0_6"] } signal-hook-mio = { version = "0.2.1", features = ["support-v0_6"] }