Compare commits

...

4 Commits

Author SHA1 Message Date
Mikayla
04558cb563 Add guard for mode refresh 2024-06-25 11:05:24 -07:00
Mikayla
da456c33a0 ? 2024-06-25 11:04:53 -07:00
Mikayla
04e243f01e clippy 2024-06-25 09:24:47 -07:00
Mikayla
e7827d5069 Fix a bug introduced by #13479 2024-06-25 08:59:45 -07:00
2 changed files with 15 additions and 1 deletions

View File

@@ -1167,6 +1167,9 @@ impl LinuxClient for X11Client {
// Adatpted from:
// https://docs.rs/winit/0.29.11/src/winit/platform_impl/linux/x11/monitor.rs.html#103-111
pub fn mode_refresh_rate(mode: &randr::ModeInfo) -> Duration {
if mode.dot_clock == 0 || mode.htotal == 0 || mode.vtotal == 0 {
return Duration::from_millis(16);
}
let millihertz = mode.dot_clock as u64 * 1_000 / (mode.htotal as u64 * mode.vtotal as u64);
let micros = 1_000_000_000 / millihertz;
log::info!("Refreshing at {} micros", micros);

View File

@@ -3826,7 +3826,8 @@ impl BackgroundScanner {
.await;
// Ensure that .git and .gitignore are processed first.
child_paths.sort_unstable();
swap_to_front(&mut child_paths, *GITIGNORE);
swap_to_front(&mut child_paths, *DOT_GIT);
for child_abs_path in child_paths {
let child_abs_path: Arc<Path> = child_abs_path.into();
@@ -4620,6 +4621,16 @@ impl BackgroundScanner {
}
}
fn swap_to_front(child_paths: &mut Vec<PathBuf>, file: &OsStr) {
let position = child_paths
.iter()
.position(|path| path.file_name().unwrap() == file);
if let Some(position) = position {
let temp = child_paths.remove(position);
child_paths.insert(0, temp);
}
}
fn char_bag_for_path(root_char_bag: CharBag, path: &Path) -> CharBag {
let mut result = root_char_bag;
result.extend(