Skip to content

mint-dock@hilyxx: Add 'Follow the mouse across screens' option and fix screen picker order - #1232

Open
yyoel wants to merge 1 commit into
linuxmint:masterfrom
yyoel:mint-dock-follow-cursor-v2
Open

yyoel wants to merge 1 commit into
linuxmint:masterfrom
yyoel:mint-dock-follow-cursor-v2

Conversation

@yyoel

@yyoel yyoel commented Nov 12, 2026

Copy link
Copy Markdown

Hi @Hilyxx, thanks for Mint-Dock! This PR adds an optional feature and fixes a multi-monitor bug. Since it changes functionality, I'd appreciate your review.

New option: "Follow the mouse across screens" (Display section, off by default)

When enabled, the dock moves to the screen the mouse pointer is on.

  • The pointer must stay on the new screen for ~300 ms before the dock moves, and it never moves while a dock menu is open or a window is being dragged.
  • With autohide on, the dock arrives hidden on the new screen (no flash), then Intelligent hide / Auto hide decide as usual.
  • When the option is turned off, the dock returns to the screen chosen in the Display settings.

There is no Cinnamon signal for "pointer moved to another monitor", so it uses a 150 ms timer, similar to the existing 250 ms visibility loop. The timer only runs while the option is enabled and is removed in destroy().

Bug fix: screen picker could put the dock on the other screen

MonitorSelector.py lists screens in GDK order (primary first), but the extension used that number as a Main.layoutManager index, which can be ordered differently. On my setup, choosing "eDP-1 (0)" placed the dock on the HDMI screen. The picker index is now converted with global.display.xinerama_index_to_logical_index(), the same mapping Cinnamon's panel.js and cinnamonDBus.js use.

Note: users who picked the "wrong" label as a workaround will see the dock move to the screen they actually selected.

Implementation notes

  • Additions only: no existing line was removed or changed in extension.js or settings-schema.json. Each existing screen-choice block is kept, followed by one line calling _applyMonitorOverrides().
  • .pot regenerated with ./cinnamon-spices-makepot. Existing .po files were left for translators.
  • ./validate-spice mint-dock@hilyxx passes.

Testing

  • Linux Mint 22.2, Cinnamon 6.4.8 on X11, two screens: 1920x1080 laptop (eDP-1, primary) + 1280x720 HDMI
  • Dock at the bottom, Intelligent hide
  • Option off: picker eDP-1 / HDMI / "On primary display" each place the dock on the correct screen
  • Option on: dock follows the pointer both ways, stays hidden where windows overlap it, appears where none do

Not tested: dock on left/right/top, Auto hide mode, autohide disabled, Wayland.

@rcalixte

Copy link
Copy Markdown
Member

@yyoel Please don't close and reopen pull requests for the same work. One is fine.

@yyoel
yyoel force-pushed the mint-dock-follow-cursor-v2 branch from 70e8d10 to dd1366f Compare November 20, 2026 15:52
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.

2 participants