Maybe solved cursor visibility issue

This commit is contained in:
wheaney 2024-03-29 10:08:32 -07:00
parent 7da53847cb
commit 2f0a053a4a
2 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ export const MouseSpriteContent = GObject.registerClass({
let [minFilter, magFilter] = actor.get_content_scaling_filters();
let textureNode = new Clutter.TextureNode(this._texture,
color, minFilter, magFilter);
textureNode.set_name('SoftBrightnessPlusMouseSpriteContent');
textureNode.set_name('BreezyDesktopSpriteContent');
node.add_child(textureNode);
textureNode.add_rectangle(actor.get_content_box());

View File

@ -147,6 +147,7 @@ export class CursorManager {
this._cursorTrackerSetPointerVisible = Meta.CursorTracker.prototype.set_pointer_visible;
this._cursorTrackerSetPointerVisibleBound = this._cursorTrackerSetPointerVisible.bind(this._cursorTracker);
Meta.CursorTracker.prototype.set_pointer_visible = this._cursorTrackerSetPointerVisibleReplacement.bind(this);
this._cursorTrackerSetPointerVisibleBound(false);
this._cursorSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
this._cursorSprite.content = new MouseSpriteContent();
@ -165,6 +166,7 @@ export class CursorManager {
this._stopCloningShowMouse();
console.log('_disableCloningMouse()');
this._cursorTrackerSetPointerVisibleBound(this._cursorWantedVisible);
Meta.CursorTracker.prototype.set_pointer_visible = this._cursorTrackerSetPointerVisible;
this._cursorWantedVisible = null;
@ -181,7 +183,6 @@ export class CursorManager {
if (!this._isMouseClonable()) {
return;
}
this._cursorTrackerSetPointerVisibleBound(visible);
}
_cursorTrackerSetPointerVisibleReplacement(visible) {
@ -211,12 +212,11 @@ export class CursorManager {
this._mainActor.add_actor(this._cursorActor);
this._cursorChangedConnection = this._cursorTracker.connect('cursor-changed', this._updateMouseSprite.bind(this));
this._cursorVisibilityChangedConnection = this._cursorTracker.connect('visibility-changed', this._updateMouseSprite.bind(this));
const interval = 1000 / 60;
const interval = 1000 / 100;
console.log('_startCloningMouse(): watch interval = ' + interval + ' ms');
this._cursorWatch = this._cursorWatcher.addWatch(interval, this._updateMousePosition.bind(this));
this._updateMouseSprite();
this._updateMousePosition();
}
this._setPointerVisible(false);
@ -268,8 +268,7 @@ export class CursorManager {
this._clearDelayedSetPointerInvibleCallbacks();
}
_updateMousePosition(actor, event) {
const [x, y, mask] = global.get_pointer();
_updateMousePosition(x, y) {
this._cursorActor.set_position(x, y);
// this._delayedSetPointerInvisible();
}
@ -288,6 +287,7 @@ export class CursorManager {
translation_x: -xHot,
translation_y: -yHot,
});
this._cursorTrackerSetPointerVisibleBound(false);
// this._delayedSetPointerInvisible();
}