Selaa lähdekoodia

fix: Add missing allowlist config for cursor apis, closes #5207 (#5211)

Fabian-Lars 2 vuotta sitten
vanhempi
sitoutus
c764408da7
3 muutettua tiedostoa jossa 53 lisäystä ja 0 poistoa
  1. 5 0
      .changes/cursor-config.md
  2. 16 0
      core/tauri-utils/src/config.rs
  3. 32 0
      tooling/cli/schema.json

+ 5 - 0
.changes/cursor-config.md

@@ -0,0 +1,5 @@
+---
+"tauri-utils": patch
+---
+
+Add missing allowlist config for `set_cursor_grab`, `set_cursor_visible`, `set_cursor_icon` and `set_cursor_position` APIs.

+ 16 - 0
core/tauri-utils/src/config.rs

@@ -1322,6 +1322,18 @@ pub struct WindowAllowlistConfig {
   /// Allows setting the skip_taskbar flag of the window.
   #[serde(default, alias = "set-skip-taskbar")]
   pub set_skip_taskbar: bool,
+  /// Allows grabbing the cursor.
+  #[serde(default, alias = "set-cursor-grab")]
+  pub set_cursor_grab: bool,
+  /// Allows setting the cursor visibility.
+  #[serde(default, alias = "set-cursor-visible")]
+  pub set_cursor_visible: bool,
+  /// Allows changing the cursor icon.
+  #[serde(default, alias = "set-cursor-icon")]
+  pub set_cursor_icon: bool,
+  /// Allows setting the cursor position.
+  #[serde(default, alias = "set-cursor-position")]
+  pub set_cursor_position: bool,
   /// Allows start dragging on the window.
   #[serde(default, alias = "start-dragging")]
   pub start_dragging: bool,
@@ -1356,6 +1368,10 @@ impl Allowlist for WindowAllowlistConfig {
       set_focus: true,
       set_icon: true,
       set_skip_taskbar: true,
+      set_cursor_grab: true,
+      set_cursor_visible: true,
+      set_cursor_icon: true,
+      set_cursor_position: true,
       start_dragging: true,
       print: true,
     };

+ 32 - 0
tooling/cli/schema.json

@@ -100,6 +100,10 @@
             "print": false,
             "requestUserAttention": false,
             "setAlwaysOnTop": false,
+            "setCursorGrab": false,
+            "setCursorIcon": false,
+            "setCursorPosition": false,
+            "setCursorVisible": false,
             "setDecorations": false,
             "setFocus": false,
             "setFullscreen": false,
@@ -362,6 +366,10 @@
               "print": false,
               "requestUserAttention": false,
               "setAlwaysOnTop": false,
+              "setCursorGrab": false,
+              "setCursorIcon": false,
+              "setCursorPosition": false,
+              "setCursorVisible": false,
               "setDecorations": false,
               "setFocus": false,
               "setFullscreen": false,
@@ -1528,6 +1536,10 @@
             "print": false,
             "requestUserAttention": false,
             "setAlwaysOnTop": false,
+            "setCursorGrab": false,
+            "setCursorIcon": false,
+            "setCursorPosition": false,
+            "setCursorVisible": false,
             "setDecorations": false,
             "setFocus": false,
             "setFullscreen": false,
@@ -1900,6 +1912,26 @@
           "default": false,
           "type": "boolean"
         },
+        "setCursorGrab": {
+          "description": "Allows grabbing the cursor.",
+          "default": false,
+          "type": "boolean"
+        },
+        "setCursorVisible": {
+          "description": "Allows setting the cursor visibility.",
+          "default": false,
+          "type": "boolean"
+        },
+        "setCursorIcon": {
+          "description": "Allows changing the cursor icon.",
+          "default": false,
+          "type": "boolean"
+        },
+        "setCursorPosition": {
+          "description": "Allows setting the cursor position.",
+          "default": false,
+          "type": "boolean"
+        },
         "startDragging": {
           "description": "Allows start dragging on the window.",
           "default": false,