summarylogtreecommitdiffstats
path: root/wiggle-gnome49.patch
blob: f8b9342880cf00cb6119c0557b5ef7bc8afa0d54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff -ura wiggle-5/cursor.js wiggle-5.new/cursor.js
--- wiggle-5/cursor.js	2024-08-26 19:11:16.000000000 +0300
+++ wiggle-5.new/cursor.js	2025-09-23 22:14:39.917795889 +0300
@@ -1,11 +1,16 @@
 'use strict';
 
 import Clutter from 'gi://Clutter';
+import * as Config from 'resource:///org/gnome/shell/misc/config.js';
 import Meta from 'gi://Meta';
 
 export default class Cursor {
     constructor() {
-        this._tracker = Meta.CursorTracker.get_for_display(global.display);
+        if (Config.PACKAGE_VERSION < 48) {
+            this._tracker = Meta.CursorTracker.get_for_display(global.display);
+        } else {
+            this._tracker = global.backend.get_cursor_tracker();
+        }
     }
 
     get hot() {
@@ -16,6 +21,16 @@
         return this._tracker.get_sprite();
     }
 
+    controlCursorVisibility(showCursor) {
+        if (Config.PACKAGE_VERSION < 49) {
+            this._tracker.set_pointer_visible(showCursor);
+        } else if (showCursor) {
+            this._tracker.uninhibit_cursor_visibility();
+        } else {
+            this._tracker.inhibit_cursor_visibility();
+        }
+    }
+
     show() {
         const seat = Clutter.get_default_backend().get_default_seat();
 
@@ -24,7 +39,7 @@
         }
 
         this._tracker.disconnectObject(this);
-        this._tracker.set_pointer_visible(true);
+        this.controlCursorVisibility(true);
     }
 
     hide() {
@@ -33,13 +48,12 @@
         if (!seat.is_unfocus_inhibited()) {
             seat.inhibit_unfocus();
         }
-
-        this._tracker.set_pointer_visible(false);
+        this.controlCursorVisibility(false);
         this._tracker.disconnectObject(this);
         this._tracker.connectObject(
             'visibility-changed', () => {
                 if (this._tracker.get_pointer_visible()) {
-                    this._tracker.set_pointer_visible(false);
+                    this.controlCursorVisibility(false);
                 }
             },
             this
diff -ura wiggle-5/metadata.json wiggle-5.new/metadata.json
--- wiggle-5/metadata.json	2024-08-26 19:11:16.000000000 +0300
+++ wiggle-5.new/metadata.json	2025-09-22 21:08:23.000000000 +0300
@@ -3,7 +3,9 @@
   "name": "Wiggle",
   "shell-version": [
     "46",
-    "47"
+    "47",
+    "48",
+    "49"
   ],
   "url": "https://github.com/mechtifs/wiggle",
   "uuid": "wiggle@mechtifs",