1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Focus new windows on macOS

This commit is contained in:
Chris 2024-11-02 12:23:33 -07:00 committed by GitHub
parent d552c6b251
commit 39ea7271e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

View file

@ -10,6 +10,10 @@ Notable changes to the `alacritty_terminal` crate are documented in its
## 0.15.0-dev ## 0.15.0-dev
### Changed
- Always focus new windows on macOS
### Fixed ### Fixed
- Mouse/Vi cursor hint highlighting broken on the terminal cursor line - Mouse/Vi cursor hint highlighting broken on the terminal cursor line

View file

@ -484,6 +484,10 @@ impl Display {
window.set_visible(true); window.set_visible(true);
// Always focus new windows, even if no Alacritty window is currently focused.
#[cfg(target_os = "macos")]
window.focus_window();
#[allow(clippy::single_match)] #[allow(clippy::single_match)]
#[cfg(not(windows))] #[cfg(not(windows))]
if !_tabbed { if !_tabbed {

View file

@ -224,6 +224,12 @@ impl Window {
self.window.set_visible(visibility); self.window.set_visible(visibility);
} }
#[cfg(target_os = "macos")]
#[inline]
pub fn focus_window(&self) {
self.window.focus_window();
}
/// Set the window title. /// Set the window title.
#[inline] #[inline]
pub fn set_title(&mut self, title: String) { pub fn set_title(&mut self, title: String) {