fix(gui): fix UAC SmartScreen and scrolling UI layout

This commit is contained in:
ospab 2026-07-08 22:45:03 +03:00
parent a547ebff17
commit db581ca391
3 changed files with 19 additions and 15 deletions

View File

@ -768,7 +768,12 @@ fn launch_as_admin(exe: &std::path::PathBuf, token: &str, port: u16) -> anyhow::
let cwd_path = std::env::current_exe().unwrap_or_else(|_| std::path::PathBuf::from(".")); let cwd_path = std::env::current_exe().unwrap_or_else(|_| std::path::PathBuf::from("."));
let dir_wstr: Vec<u16> = cwd_path.parent().unwrap_or(std::path::Path::new(".")).as_os_str().encode_wide().chain(Some(0)).collect(); let dir_wstr: Vec<u16> = cwd_path.parent().unwrap_or(std::path::Path::new(".")).as_os_str().encode_wide().chain(Some(0)).collect();
let ret = unsafe { ShellExecuteW(null_mut(), verb_wstr.as_ptr(), exe_wstr.as_ptr(), params_wstr.as_ptr(), dir_wstr.as_ptr(), 0) }; // Remove Mark of the Web (Zone.Identifier) so SmartScreen doesn't block UAC
let zone_id = format!("{}:Zone.Identifier", exe.display());
let _ = std::fs::remove_file(zone_id);
// Use SW_SHOWNORMAL (1) instead of SW_HIDE (0) because runas with SW_HIDE is automatically blocked by UAC
let ret = unsafe { ShellExecuteW(null_mut(), verb_wstr.as_ptr(), exe_wstr.as_ptr(), params_wstr.as_ptr(), dir_wstr.as_ptr(), 1) };
// ShellExecuteW's return is a pseudo-HINSTANCE: > 32 means the call itself // ShellExecuteW's return is a pseudo-HINSTANCE: > 32 means the call itself
// "succeeded" — but that range INCLUDES ERROR_CANCELLED (1223), which is // "succeeded" — but that range INCLUDES ERROR_CANCELLED (1223), which is

View File

@ -280,10 +280,11 @@
</label> </label>
</div> </div>
</div> </div> <!-- client-settings-card -->
<div class="app-version" id="app-version">OSTP GUI</div> <div class="app-version" id="app-version">OSTP GUI</div>
</div> </div> <!-- settings-body -->
</div> </div> <!-- settings-screen -->
<!-- ── ADD PROFILE DROPDOWN ─────────────────────────────── --> <!-- ── ADD PROFILE DROPDOWN ─────────────────────────────── -->
<div id="add-menu" class="add-menu hidden"> <div id="add-menu" class="add-menu hidden">

View File

@ -84,7 +84,7 @@
/* ── Reset ───────────────────────────────────────────────────────────── */ /* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: var(--c-bg); overflow: hidden; user-select: none; } html, body { width: 100%; height: 100%; background: var(--c-bg); user-select: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; } button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; } input, textarea, select { font-family: inherit; }
a { text-decoration: none; } a { text-decoration: none; }
@ -356,8 +356,12 @@ a { text-decoration: none; }
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center;
gap: 2px; gap: 2px;
padding: 10px 18px; padding: 10px 4px;
flex: 1;
min-width: 80px;
white-space: nowrap;
} }
.live-stat-label { .live-stat-label {
font-size: 0.6rem; font-size: 0.6rem;
@ -408,19 +412,13 @@ a { text-decoration: none; }
.settings-body { .settings-body {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
display: flex; overflow-y: scroll;
flex-direction: column; scrollbar-width: none;
gap: 0;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.07) transparent;
padding-bottom: 20px; padding-bottom: 20px;
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.settings-body::-webkit-scrollbar { width: 3px; } .settings-body::-webkit-scrollbar { display: none; }
.settings-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 10px; }
/* ── Profile list ────────────────────────────────────────────────────── */ /* ── Profile list ────────────────────────────────────────────────────── */
.profile-list { .profile-list {