Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai fda6093b94 fix(window): keep the window buttons of a group in simple fullscreen
Simple fullscreen drops the title bar and resizing, which removed the window buttons and disabled the green one. Keep the transparent title bar and resizing, with a minimum size of the whole screen so the edges can't be dragged; the green button leads back out of fullscreen.
2026-11-04 16:34:33 +08:00
l0ng-ai d0cdd589c7 fix(window): keep a fullscreen project window group in one Space on macOS
Native fullscreen gives each window its own Space, so switching projects in a
fullscreen window group left one Space and entered another: the desktop showed
in between, and quick switching could drop out of fullscreen.

A grouped window now uses simple fullscreen for every member at once. The group
stays in one Space at screen size, and switching projects only shows one window
and hides the others. The green button, the system Enter Full Screen item and
Toggle Full Screen all take this path for grouped windows; ungrouped windows keep
native fullscreen. Menu bar and Dock auto-hide while any window is in simple
fullscreen. Detaching or closing a tab keeps the rest of the group fullscreen.
2026-11-04 16:34:33 +08:00
4 змінених файлів з 15 додано та 46 видалено

No files matched your search

+14 -30
Переглянути файл
@@ -123,19 +123,6 @@ fn misbehave_pkg() -> PathBuf {
repo().join("crates/ide-plugin/tests/fixtures/misbehave")
}
/// Whether `f` holds within 5 s. A call a slow runner keeps waiting behind
/// another (or behind a new instance starting) holds once it caught up.
fn eventually(mut f: impl FnMut() -> bool) -> bool {
let until = Instant::now() + Duration::from_secs(5);
while !f() {
if Instant::now() > until {
return false;
}
std::thread::sleep(Duration::from_millis(20));
}
true
}
/// A theme package with a light and a dark theme, plus licence files, in `dir`.
fn write_theme_pair(dir: &Path) {
std::fs::create_dir_all(dir.join("t")).unwrap();
@@ -410,11 +397,11 @@ fn crashes_restart_with_backoff_until_the_circuit_opens() {
let info = f.host.info_of("misbehave").unwrap();
assert_eq!((info.status, info.stats.activations, info.error), (PluginStatus::Active, 2, None));
// Three in a row: stopped for the session, backing off between them (the wait
// doubles: `Limits::backoff`, tested where it is defined; wall-clock waits on CI
// are too noisy to compare).
// Three in a row: stopped for the session, with growing waits between.
f.take_events();
for crash in 0..3 {
let mut waits = Vec::new();
for _ in 0..3 {
let started = Instant::now();
let err = loop {
match f.run("misbehave", "panic", None) {
Err(e) if e.contains("restarts in") => std::thread::sleep(Duration::from_millis(20)),
@@ -422,10 +409,9 @@ fn crashes_restart_with_backoff_until_the_circuit_opens() {
}
};
assert!(err.contains("crashed"), "{err}");
if crash < 2 {
assert!(f.run("misbehave", "echo", None).unwrap_err().contains("restarts in"), "backing off");
}
waits.push(started.elapsed());
}
assert!(waits[2] >= backoff * 2 && waits[2] > waits[1], "{waits:?}");
let info = f.host.info_of("misbehave").unwrap();
assert_eq!(info.status, PluginStatus::Failed);
assert!(info.error.as_deref().is_some_and(|e| e.contains("3 times in a row")), "{:?}", info.error);
@@ -546,10 +532,10 @@ fn edit_path_calls_have_soft_and_hard_deadlines() {
// Slower than the soft deadline: dropped (however late this thread gets
// to look), but the instance lives on.
assert!(provider.highlights(&mis, "sleep:150").is_none());
assert!(eventually(|| provider.highlights(&mis, "fast").is_some()));
std::thread::sleep(Duration::from_millis(150));
assert!(provider.highlights(&mis, "fast").is_some());
let info = host.info_of("misbehave").unwrap();
assert!(info.stats.slow_calls >= 1, "{:?}", info.stats);
assert_eq!((info.stats.crashes, info.stats.activations), (0, 1));
assert_eq!((info.stats.slow_calls, info.stats.crashes, info.stats.activations), (1, 0, 1));
// Past the hard deadline: interrupted; the next call gets a new instance.
assert!(provider.highlights(&mis, "spin").is_none());
@@ -558,8 +544,7 @@ fn edit_path_calls_have_soft_and_hard_deadlines() {
let info = host.info_of("misbehave").unwrap();
assert_eq!(info.stats.crashes, 1, "{:?}", info.error);
assert!(info.error.as_deref().is_some_and(|e| e.contains("timed out after 400ms")), "{:?}", info.error);
// The new instance may take longer to start than the soft deadline on a slow runner.
assert!(eventually(|| provider.highlights(&mis, "fast").is_some()));
assert!(provider.highlights(&mis, "fast").is_some());
assert_eq!(host.info_of("misbehave").unwrap().stats.activations, 2);
}
@@ -568,10 +553,9 @@ fn edit_path_calls_have_soft_and_hard_deadlines() {
#[test]
fn providers_of_several_plugins_run_concurrently() {
let tmp = tempfile::tempdir().unwrap();
// A budget no runner misses, so only the overlap is measured.
let limits = Limits {
edit_soft: Duration::from_secs(5),
edit_hard: Duration::from_secs(10),
edit_soft: Duration::from_millis(300),
edit_hard: Duration::from_secs(2),
fuel: u64::MAX,
..Limits::default()
};
@@ -604,12 +588,12 @@ fn providers_of_several_plugins_run_concurrently() {
assert_eq!(host.provide_completion(&doc("fast"), at, None).len(), 2);
let started = Instant::now();
let items = host.provide_completion(&doc("sleep:500"), at, None);
let items = host.provide_completion(&doc("sleep:200"), at, None);
let elapsed = started.elapsed();
let mut from: Vec<&str> = items.iter().map(|(p, _)| p.as_str()).collect();
from.sort();
assert_eq!(from, ["slow-a", "slow-b"], "both within the budget");
assert!(elapsed < Duration::from_millis(950), "one after the other would take 1000ms: {elapsed:?}");
assert!(elapsed < Duration::from_millis(350), "one after the other would take 400ms: {elapsed:?}");
assert_eq!(host.info_of("slow-b").unwrap().stats.slow_calls, 0);
}
-10
Переглянути файл
@@ -303,16 +303,6 @@ pub fn net_host(url: &str) -> Result<String, String> {
#[cfg(test)]
mod tests {
#[test]
fn the_restart_backoff_doubles_up_to_a_minute() {
let limits = Limits { restart_backoff: Duration::from_millis(150), ..Limits::default() };
let waits: Vec<u128> = (1..=4).map(|n| limits.backoff(n).as_millis()).collect();
assert_eq!(waits, [150, 300, 600, 1200]);
assert_eq!(limits.backoff(30), Duration::from_millis(150 * 64), "the factor stops growing");
let long = Limits { restart_backoff: Duration::from_secs(10), ..Limits::default() };
assert_eq!(long.backoff(5), Duration::from_secs(60));
}
use super::*;
#[test]
+1 -5
Переглянути файл
@@ -659,10 +659,6 @@ mod maven_path_tests {
impl Subst {
fn new(target: &Path) -> Self {
// Tests run in parallel and may race for the same free letter; only a drive that
// shows this target's marker is ours.
let marker = format!("{}.subst", target.file_name().unwrap().to_string_lossy());
std::fs::write(target.join(&marker), "").unwrap();
for letter in (b'D'..=b'Z').rev() {
let name = format!("{}:", char::from(letter));
let root = PathBuf::from(format!("{name}\\"));
@@ -670,7 +666,7 @@ mod maven_path_tests {
continue;
}
let output = Command::new("subst").arg(&name).arg(target).output().unwrap();
if output.status.success() && root.join(&marker).exists() {
if output.status.success() {
return Self { name, root };
}
}
-1
Переглянути файл
@@ -202,7 +202,6 @@ pub fn detach(app: &AppHandle, caller: &str) -> IdeResult<()> {
let next = state.groups.lock().detach(caller);
if let Some(next) = next {
// The tab that stays keeps the fullscreen; the detached window opens beside it.
#[cfg(target_os = "macos")]
let simple = simple_fullscreen(caller);
if let Some(window) = app.get_webview_window(&next) {
#[cfg(target_os = "macos")]