Skip to content

Commit f0c9abb

Browse files
author
WongSaang
committed
fix(linux): show window before setting click-through to prevent GTK panic
On Linux/GTK, `set_ignore_cursor_events(true)` calls `window.window().unwrap()` in tao to access the underlying GdkWindow. If the window hasn't been shown/realized yet, the GdkWindow is None, causing a panic at runtime. Move `window.show()` before `set_ignore_cursor_events(true)` so the GdkWindow exists when the input shape region is applied.
1 parent 2bd92bd commit f0c9abb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎src-tauri/src/lib.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,13 @@ pub fn run() {
267267
let _ = window.set_position(tauri::LogicalPosition::new(0.0, 0.0));
268268
}
269269

270-
// Click-through
271-
window.set_ignore_cursor_events(true)?;
272-
273-
// Show window after ready to avoid white flash
270+
// Show window first — on Linux/GTK the underlying GdkWindow must
271+
// exist before input_shape_combine_region can be called.
274272
let _ = window.show();
275273

274+
// Click-through (must be after show on Linux)
275+
window.set_ignore_cursor_events(true)?;
276+
276277
// Sync autostart state with saved setting (default: enabled)
277278
{
278279
let autostart_mgr = app.autolaunch();

0 commit comments

Comments
 (0)