aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2024-04-23 17:42:16 +0200
committerGitHub <noreply@github.com>2024-04-23 15:42:16 +0000
commitce800bfde2a2121a830c2b0854749875b3aebf79 (patch)
treec6f6d7fbe150e5b457cf0713945a9bda797e6d27 /alacritty/src/event.rs
parent90054614c241375839571d4dd2145edcb65257a6 (diff)
downloadr-alacritty-ce800bfde2a2121a830c2b0854749875b3aebf79.tar.gz
r-alacritty-ce800bfde2a2121a830c2b0854749875b3aebf79.tar.bz2
r-alacritty-ce800bfde2a2121a830c2b0854749875b3aebf79.zip
Fix dynamic title override for multiple windows
This fixes an issue where Windows spawned after the initial one through IPC or bindings would not update their title due to the initial window having its title set through the CLI. Title changes are still inhibited for additional windows when they are spawned through `alacritty msg create-window` with the `--title` CLI option added. Closes #6836.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r--alacritty/src/event.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 4fa397ad..5276776a 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -217,6 +217,7 @@ pub struct ActionContext<'a, N, T> {
pub message_buffer: &'a mut MessageBuffer,
pub config: &'a UiConfig,
pub cursor_blink_timed_out: &'a mut bool,
+ #[cfg(target_os = "macos")]
pub event_loop: &'a EventLoopWindowTarget<Event>,
pub event_proxy: &'a EventLoopProxy<Event>,
pub scheduler: &'a mut Scheduler,
@@ -1213,7 +1214,6 @@ pub struct Mouse {
pub click_state: ClickState,
pub accumulated_scroll: AccumulatedScroll,
pub cell_side: Side,
- pub lines_scrolled: f32,
pub block_hint_launcher: bool,
pub hint_highlight_dirty: bool,
pub inside_text_area: bool,
@@ -1234,7 +1234,6 @@ impl Default for Mouse {
hint_highlight_dirty: Default::default(),
block_hint_launcher: Default::default(),
inside_text_area: Default::default(),
- lines_scrolled: Default::default(),
accumulated_scroll: Default::default(),
x: Default::default(),
y: Default::default(),
@@ -1313,7 +1312,7 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
},
TerminalEvent::ResetTitle => {
let window_config = &self.ctx.config.window;
- if window_config.dynamic_title {
+ if !self.ctx.preserve_title && window_config.dynamic_title {
self.ctx.display.window.set_title(window_config.identity.title.clone());
}
},
@@ -1694,6 +1693,7 @@ impl Processor {
};
window_context.handle_event(
+ #[cfg(target_os = "macos")]
event_loop,
&proxy,
&mut clipboard,
@@ -1708,6 +1708,7 @@ impl Processor {
// Dispatch event to all windows.
for window_context in self.windows.values_mut() {
window_context.handle_event(
+ #[cfg(target_os = "macos")]
event_loop,
&proxy,
&mut clipboard,
@@ -1794,6 +1795,7 @@ impl Processor {
WinitEvent::UserEvent(event @ Event { window_id: None, .. }) => {
for window_context in self.windows.values_mut() {
window_context.handle_event(
+ #[cfg(target_os = "macos")]
event_loop,
&proxy,
&mut clipboard,
@@ -1807,6 +1809,7 @@ impl Processor {
| WinitEvent::UserEvent(Event { window_id: Some(window_id), .. }) => {
if let Some(window_context) = self.windows.get_mut(&window_id) {
window_context.handle_event(
+ #[cfg(target_os = "macos")]
event_loop,
&proxy,
&mut clipboard,