aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2024-12-22 23:30:30 +0300
committerChristian Duerr <contact@christianduerr.com>2024-12-22 23:22:32 +0000
commitb45d2dbe5f8c0743971e870ae8e07d22fe0e4e3b (patch)
treea19a09ef0826a186da6f98440ddaf3d48f0948c7
parentccbabc90354c39c45e93a11ddb6352be9fc6178f (diff)
downloadalacritty-b45d2dbe5f8c0743971e870ae8e07d22fe0e4e3b.tar.gz
alacritty-b45d2dbe5f8c0743971e870ae8e07d22fe0e4e3b.zip
Bump winit to 0.30.7
Fixes double input on X11 after update to 0.30.6.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/Cargo.toml2
-rw-r--r--alacritty/src/event.rs40
3 files changed, 23 insertions, 20 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0190304e..379cb1f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
- `alacritty migrate` crashing with recursive toml imports
- Migrating nonexistent toml import breaking the entire migration
- Crash when pressing certain modifier keys on macOS 15+
+- First daemon mode window ignoring window options passed through CLI
## 0.14.0
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index ac369d8c..8d48bf24 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -41,7 +41,7 @@ tempfile = "3.12.0"
toml = "0.8.2"
toml_edit = "0.22.21"
unicode-width = "0.1"
-winit = { version = "0.30.6", default-features = false, features = ["rwh_06", "serde"] }
+winit = { version = "0.30.7", default-features = false, features = ["rwh_06", "serde"] }
[build-dependencies]
gl_generator = "0.14.0"
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index e82d7974..79f31eef 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -140,14 +140,14 @@ impl Processor {
pub fn create_initial_window(
&mut self,
event_loop: &ActiveEventLoop,
+ window_options: WindowOptions,
) -> Result<(), Box<dyn Error>> {
- let options = match self.initial_window_options.take() {
- Some(options) => options,
- None => return Ok(()),
- };
-
- let window_context =
- WindowContext::initial(event_loop, self.proxy.clone(), self.config.clone(), options)?;
+ let window_context = WindowContext::initial(
+ event_loop,
+ self.proxy.clone(),
+ self.config.clone(),
+ window_options,
+ )?;
self.gl_config = Some(window_context.display.gl_context().config());
self.windows.insert(window_context.id(), window_context);
@@ -225,10 +225,12 @@ impl ApplicationHandler<Event> for Processor {
return;
}
- if let Err(err) = self.create_initial_window(event_loop) {
- self.initial_window_error = Some(err);
- event_loop.exit();
- return;
+ if let Some(window_options) = self.initial_window_options.take() {
+ if let Err(err) = self.create_initial_window(event_loop, window_options) {
+ self.initial_window_error = Some(err);
+ event_loop.exit();
+ return;
+ }
}
info!("Initialisation complete");
@@ -276,7 +278,7 @@ impl ApplicationHandler<Event> for Processor {
}
// Handle events which don't mandate the WindowId.
- match (&event.payload, event.window_id.as_ref()) {
+ match (event.payload, event.window_id.as_ref()) {
// Process IPC config update.
#[cfg(unix)]
(EventType::IpcConfig(ipc_config), window_id) => {
@@ -315,7 +317,7 @@ impl ApplicationHandler<Event> for Processor {
}
// Load config and update each terminal.
- if let Ok(config) = config::reload(path, &mut self.cli_options) {
+ if let Ok(config) = config::reload(&path, &mut self.cli_options) {
self.config = Rc::new(config);
// Restart config monitor if imports changed.
@@ -346,17 +348,17 @@ impl ApplicationHandler<Event> for Processor {
if self.gl_config.is_none() {
// Handle initial window creation in daemon mode.
- if let Err(err) = self.create_initial_window(event_loop) {
+ if let Err(err) = self.create_initial_window(event_loop, options) {
self.initial_window_error = Some(err);
event_loop.exit();
}
- } else if let Err(err) = self.create_window(event_loop, options.clone()) {
+ } else if let Err(err) = self.create_window(event_loop, options) {
error!("Could not open window: {:?}", err);
}
},
// Process events affecting all windows.
- (_, None) => {
- let event = WinitEvent::UserEvent(event);
+ (payload, None) => {
+ let event = WinitEvent::UserEvent(Event::new(payload, None));
for window_context in self.windows.values_mut() {
window_context.handle_event(
#[cfg(target_os = "macos")]
@@ -405,7 +407,7 @@ impl ApplicationHandler<Event> for Processor {
}
}
},
- (_, Some(window_id)) => {
+ (payload, Some(window_id)) => {
if let Some(window_context) = self.windows.get_mut(window_id) {
window_context.handle_event(
#[cfg(target_os = "macos")]
@@ -413,7 +415,7 @@ impl ApplicationHandler<Event> for Processor {
&self.proxy,
&mut self.clipboard,
&mut self.scheduler,
- WinitEvent::UserEvent(event),
+ WinitEvent::UserEvent(Event::new(payload, *window_id)),
);
}
},