Skip to content

Commit

Permalink
Improve handling when changing mouse tracker icon
Browse files Browse the repository at this point in the history
  • Loading branch information
anaximeno committed Sep 20, 2024
1 parent 199bf91 commit 10fc103
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var MouseMovementTracker = class MouseMovementTracker {
}
if (params.icon) {
Main.uiGroup.remove_child(this.icon_actor);
const [x, y, _] = global.get_pointer();
this.icon_actor = new St.Icon({
reactive: false,
can_focus: false,
Expand All @@ -55,7 +56,10 @@ var MouseMovementTracker = class MouseMovementTracker {
opacity: this.opacity,
gicon: params.icon,
});
this.move_to(x, y);
Main.uiGroup.add_child(this.icon_actor);
if (!this.persist_on_stopped)
this.icon_actor.hide();
}
if (params.persist_on_stopped === true) {
this.persist_on_stopped = params.persist_on_stopped;
Expand All @@ -69,9 +73,7 @@ var MouseMovementTracker = class MouseMovementTracker {
finalize() {
Main.uiGroup.remove_child(this.icon_actor);
this.listener.remove();
this.listener = null;
this.icon_actor.destroy();
this.icon_actor = null;
global.log(UUID, "mouse movement tracker finalized");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,20 @@
"pause-animation-effects-enabled": {
"type": "switch",
"default": true,
"description": "Animate Effects Pause"
"description": "Animate Pause"
},
"mouse-movement-tracker-enabled": {
"type": "switch",
"default": false,
"description": "Mouse Movement Tracker"
"description": "Mouse Movement Tracker (experimental)",
"tooltip": "This is still experimental and may interfere when clicking on the panel or in some drag-and-drop operations."
},
"mouse-movement-tracker-persist-on-stopped-enabled": {
"type": "switch",
"default": false,
"description": "Persist Movement Tracker On Stopped",
"dependency": "mouse-movement-tracker-enabled"

"description": "Persist Movement Tracker On Stopped (experimental)",
"dependency": "mouse-movement-tracker-enabled",
"tooltip": "This is still experimental and may interfere when clicking on the panel or in some drag-and-drop operations."
},
"mouse-idle-watcher-enabled": {
"type": "switch",
Expand Down

0 comments on commit 10fc103

Please sign in to comment.