From 43cfa2ce037ac9ea0fb8c7539ce0d655eb0ced06 Mon Sep 17 00:00:00 2001 From: fhscey Date: Mon, 17 Nov 2025 23:55:00 +0800 Subject: [PATCH 1/3] feat: Rework fullscreen handling for cross-platform compatibility This commit refactors fullscreen mode activation to be triggered only once upon user request and extends fullscreen support to Linux. --- phira/locales/zh-CN/settings.ftl | 2 ++ phira/src/lib.rs | 3 --- phira/src/page/settings.rs | 11 +++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/phira/locales/zh-CN/settings.ftl b/phira/locales/zh-CN/settings.ftl index 3cf070637..9e7fddab5 100644 --- a/phira/locales/zh-CN/settings.ftl +++ b/phira/locales/zh-CN/settings.ftl @@ -8,6 +8,8 @@ debug = 调试 about = 关于 item-lang = 语言 +item-fullscreen = 全屏模式 +item-fullscreen-sub = 铺满整个屏幕 item-offline = 离线模式 item-offline-sub = 在离线模式下将不能上传成绩 item-server-status = 服务器状态 diff --git a/phira/src/lib.rs b/phira/src/lib.rs index f18be3eee..733752459 100644 --- a/phira/src/lib.rs +++ b/phira/src/lib.rs @@ -284,9 +284,6 @@ async fn the_main() -> Result<()> { info!("FPS {}", (1. / (t - frame_start)) as u32); } - #[cfg(target_os = "windows")] - macroquad::window::set_fullscreen(get_data().config.fullscreen_mode); - next_frame().await; } Ok(()) diff --git a/phira/src/page/settings.rs b/phira/src/page/settings.rs index 4da7b22ae..1f12f95e8 100644 --- a/phira/src/page/settings.rs +++ b/phira/src/page/settings.rs @@ -272,7 +272,7 @@ struct GeneralList { lang_btn: ChooseButton, - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] fullscreen_btn: DRectButton, cache_btn: DRectButton, @@ -305,7 +305,7 @@ impl GeneralList { .unwrap_or_default(), ), - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] fullscreen_btn: DRectButton::new(), cache_btn: DRectButton::new(), @@ -362,9 +362,12 @@ impl GeneralList { return Ok(Some(false)); } - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] if self.fullscreen_btn.touch(touch, t) { config.fullscreen_mode ^= true; + + macroquad::window::set_fullscreen(config.fullscreen_mode); + return Ok(Some(true)); } @@ -469,7 +472,7 @@ impl GeneralList { self.lang_btn.render(ui, rr, t); } - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] item! { render_title(ui, tl!("item-fullscreen"), Some(tl!("item-fullscreen-sub"))); render_switch(ui, rr, t, &mut self.fullscreen_btn, config.fullscreen_mode); From 43b0f457a3dcf90df7f9e64301d74e5bddd09a5d Mon Sep 17 00:00:00 2001 From: fhscey Date: Tue, 10 Mar 2026 14:10:00 +0800 Subject: [PATCH 2/3] refactor(windows): replace SystemTime with QPC for high-precision input timing --- prpr/src/judge.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/prpr/src/judge.rs b/prpr/src/judge.rs index ac1e46133..65fdda932 100644 --- a/prpr/src/judge.rs +++ b/prpr/src/judge.rs @@ -83,11 +83,7 @@ fn get_uptime() -> f64 { #[cfg(target_os = "windows")] fn get_uptime() -> f64 { - use std::time::SystemTime; - let start = SystemTime::UNIX_EPOCH; - let now = SystemTime::now(); - let duration = now.duration_since(start).expect("Time went backwards"); - duration.as_secs() as f64 + duration.subsec_nanos() as f64 * 1e-9 + miniquad::native::windows::get_uptime() } pub struct FlickTracker { From ea9794babfa70f6dce17594e2185a1c75ab911a4 Mon Sep 17 00:00:00 2001 From: mivik Date: Tue, 10 Mar 2026 15:00:19 +0800 Subject: [PATCH 3/3] chore: update miniquad & macroquad --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2067970f7..c79c92bc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "macroquad" version = "0.3.25" -source = "git+https://github.com/Mivik/prpr-macroquad?rev=039f957#039f95705ce0fcb8b6533de475862a769a3360aa" +source = "git+https://github.com/Mivik/prpr-macroquad?rev=2db08f2#2db08f295ff91c5ee07b044cccf5a49827345baa" dependencies = [ "bumpalo", "fontdue", @@ -2140,7 +2140,7 @@ dependencies = [ [[package]] name = "macroquad_macro" version = "0.1.7" -source = "git+https://github.com/Mivik/prpr-macroquad?rev=039f957#039f95705ce0fcb8b6533de475862a769a3360aa" +source = "git+https://github.com/Mivik/prpr-macroquad?rev=2db08f2#2db08f295ff91c5ee07b044cccf5a49827345baa" [[package]] name = "malloc_buf" @@ -2209,7 +2209,7 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniquad" version = "0.3.15" -source = "git+https://github.com/Mivik/prpr-miniquad?rev=dc26ae9#dc26ae99df38353ebd80eaf371008ce30590a22d" +source = "git+https://github.com/Mivik/prpr-miniquad?rev=018b3a7#018b3a70df431e9705959f4d53bba778f889f8da" dependencies = [ "jni 0.21.1", "keyboard-types", diff --git a/Cargo.toml b/Cargo.toml index a6f2230bd..420e9d576 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,8 +57,8 @@ objc2-foundation = "0.3.2" objc2-ui-kit = "0.3.2" objc2-uniform-type-identifiers = "0.3.2" -macroquad = { git = "https://github.com/Mivik/prpr-macroquad", rev = "039f957", default-features = false } -miniquad = { git = "https://github.com/Mivik/prpr-miniquad", rev = "dc26ae9" } +macroquad = { git = "https://github.com/Mivik/prpr-macroquad", rev = "2db08f2", default-features = false } +miniquad = { git = "https://github.com/Mivik/prpr-miniquad", rev = "018b3a7" } phira = { path = "phira", default-features = false } phira-mp-client = { git = "https://github.com/TeamFlos/phira-mp", rev = "6967475" } phira-mp-common = { git = "https://github.com/TeamFlos/phira-mp", rev = "6967475" }