Skip to content

Commit b514ecf

Browse files
committed
fix: lag in window resize
1 parent 6c3cf04 commit b514ecf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

GUI/ETVR/src-tauri/src/main.rs

+7
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ fn main() {
183183
let tray = SystemTray::new().with_menu(tray_menu);
184184

185185
tauri::Builder::default()
186+
//Note: This is a workaround for a bug in tauri that causes the window to not resize properly inducing a noticable lag
187+
// ! https://github.com/tauri-apps/tauri/issues/6322#issuecomment-1448141495
188+
.on_window_event(|e| {
189+
if let WindowEvent::Resized(_) = e.event() {
190+
std::thread::sleep(std::time::Duration::from_nanos(1));
191+
}
192+
})
186193
.invoke_handler(tauri::generate_handler![
187194
close_splashscreen,
188195
run_mdns_query,

GUI/ETVR/src/app.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const ExampleMenu = lazy(() => import('@components/NewWindow/Example'))
99
const ToastNotificationWindow = lazy(() => import('@components/Notifications'))
1010

1111
const App = () => {
12-
const ref = document.getElementById('titlebar') // TODO: this is a hack, need to figure out how to get the ref to the bound element
12+
const ref = document.getElementById('titlebar')
1313
onMount(() => {
1414
handleTitlebar()
1515
handleAppBoot()

0 commit comments

Comments
 (0)