Skip to content

Add Find Mouse effect (PowerToys Find My Mouse)#30

Draft
herve-brun wants to merge 5 commits into
mechtifs:masterfrom
herve-brun:find-mouse-effect
Draft

Add Find Mouse effect (PowerToys Find My Mouse)#30
herve-brun wants to merge 5 commits into
mechtifs:masterfrom
herve-brun:find-mouse-effect

Conversation

@herve-brun
Copy link
Copy Markdown

@herve-brun herve-brun commented Apr 25, 2026

[WIP] This PR is a work in progress and needs review before merging.

@herve-brun herve-brun marked this pull request as draft April 25, 2026 05:17
@herve-brun
Copy link
Copy Markdown
Author

herve-brun commented Apr 25, 2026

Summary

The PR adds a 'Find Mouse' effect (similar to PowerToys Find My Mouse) to the Wiggle GNOME extension. Here's what was implemented:

Changes Made:

  1. New FindMouseEffect class in effect.js:
    • Creates a circular halo using an St.Widget
    • Implements proper positioning centered on cursor hot spot
    • Manages cursor visibility when hidden
    • Follows the same pattern as existing MagnificationEffect
  2. Updated settings schema in schemas/org.gnome.shell.extensions.wiggle.gschema.xml:
    • Added effect-mode to choose between magnification and find-mouse
    • Added trigger-type for motion vs keypress activation
    • Added trigger-key to specify which key to use
    • Added halo-specific settings: color, radius, opacity
  3. Updated preferences UI in prefs.js:
    • New 'Effect Mode' page with mode selection
    • Trigger settings section
    • Halo appearance configuration
  4. Updated extension logic in extension.js:
    • Creates appropriate effect based on mode setting
    • Handles mode switching when settings change
    • Applies halo settings dynamically
  5. Added comprehensive tests:
    • Tests for BaseEffect base class behavior
    • Tests for MagnificationEffect functionality
    • Tests for FindMouseEffect initialization and behavior
    • Tests for History class

Bugs Fixed:

  1. Fixed add_child issue: Removed the problematic this.add_child(this._halo) call since St.Actor doesn't have an add_child method.
  2. Fixed positioning logic: Changed to use set_content() and simplified the position calculation in move().
  3. Updated setting handlers: Modified extension.js to use get_content().set_style() and get_content().set_size() instead of accessing _halo directly.

Test Results:

All tests pass successfully:

  • ✓ BaseEffect base class behavior
  • ✓ MagnificationEffect initialization and methods
  • ✓ FindMouseEffect halo properties and positioning
  • ✓ FindMouseEffect activation/deactivation
  • ✓ History tracking functionality
    The implementation follows existing patterns in the codebase and integrates well with the current architecture. The Find Mouse effect provides an alternative visualization for locating the cursor, complementing the existing magnification effect.

@herve-brun
Copy link
Copy Markdown
Author

Summary

The PR adds a 'Find Mouse' effect (similar to PowerToys Find My Mouse) to the Wiggle GNOME extension. Here's what was implemented:

Changes Made:

  1. New class in :

    • Creates a circular halo using an
    • Implements proper positioning centered on cursor hot spot
    • Manages cursor visibility when hidden
    • Follows the same pattern as existing
  2. Updated settings schema in :

    • Added to choose between magnification and find-mouse
    • Added for motion vs keypress activation
    • Added to specify which key to use
    • Added halo-specific settings: color, radius, opacity
  3. Updated preferences UI in :

    • New 'Effect Mode' page with mode selection
    • Trigger settings section
    • Halo appearance configuration
  4. Updated extension logic in :

    • Creates appropriate effect based on mode setting
    • Handles mode switching when settings change
    • Applies halo settings dynamically
  5. Added comprehensive tests:

    • Tests for BaseEffect base class behavior
    • Tests for MagnificationEffect functionality
    • Tests for FindMouseEffect initialization and behavior
    • Tests for History class

Bugs Fixed:

  1. Fixed issue: Removed the problematic call since doesn't have an method.

  2. Fixed positioning logic: Changed to use and simplified the position calculation in .

  3. Updated setting handlers: Modified extension.js to use and instead of accessing directly.

Test Results:

All tests pass successfully:

  • ✓ BaseEffect base class behavior
  • ✓ MagnificationEffect initialization and methods
  • ✓ FindMouseEffect halo properties and positioning
  • ✓ FindMouseEffect activation/deactivation
  • ✓ History tracking functionality

The implementation follows existing patterns in the codebase and integrates well with the current architecture. The Find Mouse effect provides an alternative visualization for locating the cursor, complementing the existing magnification effect.

Hervé BRUN and others added 5 commits April 29, 2026 23:55
…ith Meta.CursorTracker.get_for_display for GNOME 46+ compatibility

- cursor.js: Replace deprecated API call with Meta.CursorTracker.get_for_display()
- cursor.js: Add destroy() method for proper signal cleanup
- effect.js: Update destroy() to properly cleanup cursor instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant