Add allow_automatic_tabbing task to runtime::window

Co-authored-by: Karolis Ramanauskas <karolisr@gmail.com>
This commit is contained in:
Héctor Ramón Jiménez 2025-11-25 23:13:36 +01:00
parent c1acd8cdda
commit aef64e56b8
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 35 additions and 5 deletions

View file

@ -435,6 +435,16 @@ where
self.error = Some(error);
event_loop.exit();
}
Control::SetAutomaticWindowTabbing(_enabled) => {
#[cfg(target_os = "macos")]
{
use winit::platform::macos::ActiveEventLoopExtMacOS;
event_loop
.set_allows_automatic_window_tabbing(
_enabled,
);
}
}
},
_ => {
break;
@ -492,6 +502,7 @@ enum Control {
on_open: oneshot::Sender<window::Id>,
scale_factor: f32,
},
SetAutomaticWindowTabbing(bool),
}
async fn run_instance<P>(
@ -1657,6 +1668,11 @@ fn run_action<'a, P, C>(
let _ = channel.send(size);
}
}
window::Action::SetAllowAutomaticTabbing(enabled) => {
control_sender
.start_send(Control::SetAutomaticWindowTabbing(enabled))
.expect("Send control action");
}
window::Action::RedrawAll => {
for (_id, window) in window_manager.iter_mut() {
window.raw.request_redraw();