Skip to content

Commit c764408

Browse files
authored
fix: Add missing allowlist config for cursor apis, closes #5207 (#5211)
1 parent 2954f6d commit c764408

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.changes/cursor-config.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-utils": patch
3+
---
4+
5+
Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.

core/tauri-utils/src/config.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,18 @@ pub struct WindowAllowlistConfig {
13221322
/// Allows setting the skip_taskbar flag of the window.
13231323
#[serde(default, alias = "set-skip-taskbar")]
13241324
pub set_skip_taskbar: bool,
1325+
/// Allows grabbing the cursor.
1326+
#[serde(default, alias = "set-cursor-grab")]
1327+
pub set_cursor_grab: bool,
1328+
/// Allows setting the cursor visibility.
1329+
#[serde(default, alias = "set-cursor-visible")]
1330+
pub set_cursor_visible: bool,
1331+
/// Allows changing the cursor icon.
1332+
#[serde(default, alias = "set-cursor-icon")]
1333+
pub set_cursor_icon: bool,
1334+
/// Allows setting the cursor position.
1335+
#[serde(default, alias = "set-cursor-position")]
1336+
pub set_cursor_position: bool,
13251337
/// Allows start dragging on the window.
13261338
#[serde(default, alias = "start-dragging")]
13271339
pub start_dragging: bool,
@@ -1356,6 +1368,10 @@ impl Allowlist for WindowAllowlistConfig {
13561368
set_focus: true,
13571369
set_icon: true,
13581370
set_skip_taskbar: true,
1371+
set_cursor_grab: true,
1372+
set_cursor_visible: true,
1373+
set_cursor_icon: true,
1374+
set_cursor_position: true,
13591375
start_dragging: true,
13601376
print: true,
13611377
};

tooling/cli/schema.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@
100100
"print": false,
101101
"requestUserAttention": false,
102102
"setAlwaysOnTop": false,
103+
"setCursorGrab": false,
104+
"setCursorIcon": false,
105+
"setCursorPosition": false,
106+
"setCursorVisible": false,
103107
"setDecorations": false,
104108
"setFocus": false,
105109
"setFullscreen": false,
@@ -362,6 +366,10 @@
362366
"print": false,
363367
"requestUserAttention": false,
364368
"setAlwaysOnTop": false,
369+
"setCursorGrab": false,
370+
"setCursorIcon": false,
371+
"setCursorPosition": false,
372+
"setCursorVisible": false,
365373
"setDecorations": false,
366374
"setFocus": false,
367375
"setFullscreen": false,
@@ -1528,6 +1536,10 @@
15281536
"print": false,
15291537
"requestUserAttention": false,
15301538
"setAlwaysOnTop": false,
1539+
"setCursorGrab": false,
1540+
"setCursorIcon": false,
1541+
"setCursorPosition": false,
1542+
"setCursorVisible": false,
15311543
"setDecorations": false,
15321544
"setFocus": false,
15331545
"setFullscreen": false,
@@ -1900,6 +1912,26 @@
19001912
"default": false,
19011913
"type": "boolean"
19021914
},
1915+
"setCursorGrab": {
1916+
"description": "Allows grabbing the cursor.",
1917+
"default": false,
1918+
"type": "boolean"
1919+
},
1920+
"setCursorVisible": {
1921+
"description": "Allows setting the cursor visibility.",
1922+
"default": false,
1923+
"type": "boolean"
1924+
},
1925+
"setCursorIcon": {
1926+
"description": "Allows changing the cursor icon.",
1927+
"default": false,
1928+
"type": "boolean"
1929+
},
1930+
"setCursorPosition": {
1931+
"description": "Allows setting the cursor position.",
1932+
"default": false,
1933+
"type": "boolean"
1934+
},
19031935
"startDragging": {
19041936
"description": "Allows start dragging on the window.",
19051937
"default": false,

0 commit comments

Comments
 (0)