Skip to content

fix(windows): Fix cursor visibility toggle not working on Windows - #1249

Open
keufcp wants to merge 1 commit into
tauri-apps:devfrom
keufcp:fix-windows-cursor
Open

fix(windows): Fix cursor visibility toggle not working on Windows #1249
keufcp wants to merge 1 commit into
tauri-apps:devfrom
keufcp:fix-windows-cursor

Conversation

@keufcp

@keufcp keufcp commented Jun 28, 2026

Copy link
Copy Markdown

Summary

This PR fixes an issue where window.set_cursor_visible(false) does not work correctly on Windows.
I rewrote #1203.

Tests

  1. cargo test -> PASS
  2. cargo fmt --check -> PASS
  3. cargo clippy -- -D warnings -> PASS only for the scope of this PR. There are multiple warnings in the code unrelated to this PR, which are not addressed.
  4. Added main_window.set_cursor_visible(false); to line 41 of tao\examples\parentwindow.rs and tested. See the video.
  5. Tested with tao\examples\cursor.rs. Works normally.
  6. Created a test TauriApp and tested the behavior. See the video.
    Setup - Created a new Tauri command and implemented it to be called from the frontend:
// src-tauri\src\lib.rs
#[tauri::command]
fn hide_cursor(window: tauri::WebviewWindow) {
    let _ = window.set_cursor_visible(false);
}

#[tauri::command]
fn show_cursor(window: tauri::WebviewWindow) {
    let _ = window.set_cursor_visible(true);
}
2026-06-19_tao.mp4

Environment

rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\keufcp\.rustup

installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (active, default)

active toolchain
----------------
name: stable-x86_64-pc-windows-msvc
active because: it's the default toolchain
installed targets:
  aarch64-linux-android
  wasm32-unknown-unknown
  wasm32-wasip2
  x86_64-linux-android
  x86_64-pc-windows-msvc
OS name:                 Microsoft Windows 11 Pro
OS version:              10.0.26200 N/A Build 26200
BIOS version:            American Megatrends Inc. 1825, 2025/10/09

Closes tauri-apps/tauri#10231

Copilot AI review requested due to automatic review settings June 28, 2026 15:54
@keufcp
keufcp requested a review from a team as a code owner June 28, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through d7ef9f5

There are 1 changes which include tao with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.35.3 0.36.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master

Copy link
Copy Markdown
Contributor

Didn't look at the code closely yet, just want to first say it works in the tauri's api example for me now, good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] window.set_cursor_visible(false) does not work.

3 participants