mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 13:52:55 +03:00
macos: cleanup
This commit is contained in:
parent
86e42e1c58
commit
a1f0dca655
@ -2024,7 +2024,6 @@ fn compute_default_actions() -> Vec<KeyAssignment> {
|
||||
ScrollToBottom,
|
||||
// ----------------- Window
|
||||
ToggleFullScreen,
|
||||
#[cfg(target_os = "macos")]
|
||||
ToggleFloatingWindow,
|
||||
Hide,
|
||||
Search(Pattern::CurrentSelectionOrEmptyString),
|
||||
|
@ -2514,8 +2514,8 @@ impl TermWindow {
|
||||
match window.level().await {
|
||||
Ok(level) => {
|
||||
match level {
|
||||
WindowLevel::Floating => window.set_level(WindowLevel::Normal),
|
||||
_ => window.set_level(WindowLevel::Floating),
|
||||
WindowLevel::AlwaysOnTop => window.set_level(WindowLevel::Normal),
|
||||
_ => window.set_level(WindowLevel::AlwaysOnTop),
|
||||
};
|
||||
}
|
||||
Err(e) => {
|
||||
|
@ -295,8 +295,10 @@ pub trait WindowOps {
|
||||
fn set_clipboard(&self, clipboard: Clipboard, text: String);
|
||||
|
||||
/// Set window level. Depending on the environment and user preferences
|
||||
fn set_window_level(&self, level: WindowLevel) {
|
||||
// default implementation does nothing
|
||||
fn set_window_level(&self, _level: WindowLevel) {}
|
||||
|
||||
fn get_window_level(&self) -> Future<WindowLevel> {
|
||||
WindowLevel::Normal
|
||||
}
|
||||
|
||||
/// Set the icon for the window.
|
||||
|
@ -747,11 +747,17 @@ impl WindowOps for Window {
|
||||
|
||||
fn set_window_level(&self, level: WindowLevel) {
|
||||
Connection::with_window_inner(self.id, move |inner| {
|
||||
inner.set_level(level as i64);
|
||||
inner.set_window_level(level);
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
||||
fn level(&self) -> Future<WindowLevel> {
|
||||
Connection::with_window_inner(self.id, move |inner| {
|
||||
Ok(inner.level())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fn set_inner_size(&self, width: usize, height: usize) {
|
||||
Connection::with_window_inner(self.id, move |inner| {
|
||||
@ -1167,7 +1173,13 @@ impl WindowInner {
|
||||
}
|
||||
}
|
||||
|
||||
fn set_level(&mut self, level: WindowLevel) {
|
||||
fn level(&self) -> WindowLevel {
|
||||
unsafe {
|
||||
NSWindow::level(*self.window).into()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_window_level(&mut self, level: WindowLevel) {
|
||||
unsafe {
|
||||
NSWindow::setLevel_(*self.window, match level {
|
||||
WindowLevel::AlwaysOnBottom => -1,
|
||||
|
Loading…
Reference in New Issue
Block a user