DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

Mouse Focus Follow

Open Hedayatbakhshi opened this issue 10 months ago • 2 comments

Feature Description

Hello to everyone, I want to suggest a feature for DMS. Is there any option that we switch to mouse focus like hyprland. This screenshot is an example for it:

Image

This picture is from Gnome in Tweak, but I really want it for the DMS. It will be a good to add this feature in the future. Thanks to everyone who contributed!

Use Case

It will be a good feature :D

Compositor(s)

  • [x] All compositors
  • [ ] Niri
  • [ ] Hyprland
  • [ ] MangoWC (dwl)
  • [ ] Sway
  • [ ] Other (specify below)

Proposed Solution

No response

Alternatives/Existing Solutions

Image

Hedayatbakhshi avatar Jan 22 '26 05:01 Hedayatbakhshi

This is a feature that is compositor dependant rather than DMS. If you're asking for niri, it does have this feature: https://github.com/YaLTeR/niri/wiki/Configuration:-Input#focus-follows-mouse

LuckShiba avatar Jan 22 '26 05:01 LuckShiba

Yes that's worked! You need to uncomment those codes in config.kdl like this:


input {
    keyboard {
        xkb {
            // You can set rules, model, layout, variant and options.
            // For more information, see xkeyboard-config(7).

            // For example:
            // layout "us,ru"
            // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"

            // If this section is empty, niri will fetch xkb settings
            // from org.freedesktop.locale1. You can control these using
            // localectl set-x11-keymap.

            layout "us,ir"
            options "grp:win_space_toggle,compose:ralt"
        }
        
        // Enable numlock on startup, omitting this setting disables it.
        numlock
    }
  

    // Next sections include libinput settings.
    // Omitting settings disables them, or leaves them at their default values.
    // All commented-out settings here are examples, not defaults.
    touchpad {
        // off
        tap
        // dwt
        // dwtp
        // drag false
        // drag-lock
        natural-scroll
        accel-speed 0.8
        // accel-profile "flat"
        // scroll-method "two-finger"
        // disabled-on-external-mouse
    }

    mouse {
        // off
        // natural-scroll
         accel-speed 0.7
        // accel-profile "flat"
        // scroll-method "no-scroll"
    }

    trackpoint {
        // off
        // natural-scroll
        // accel-speed 0.2
        // accel-profile "flat"
        // scroll-method "on-button-down"
        // scroll-button 273
        // scroll-button-lock
        // middle-emulation
    }

    // Uncomment this to make the mouse warp to the center of newly focused windows.
    // warp-mouse-to-focus

    // Focus windows and outputs automatically when moving the mouse into them.
    // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
    // focus-follows-mouse max-scroll-amount="0%"

    focus-follows-mouse // **HERE**

}

Thanks! @LuckShiba

Hedayatbakhshi avatar Jan 22 '26 07:01 Hedayatbakhshi