Skip to content

icon-view: Add optional freeform (brush) selection with the right mou… - #3920

Open
yazeedali wants to merge 1 commit into
linuxmint:masterfrom
yazeedali:path-selection-fixes
Open

yazeedali wants to merge 1 commit into
linuxmint:masterfrom
yazeedali:path-selection-fixes

Conversation

@yazeedali

@yazeedali yazeedali commented Dec 5, 2026 •

Copy link
Copy Markdown

icon-view: Add optional freeform (brush) selection with the right mouse button

What

Adds an opt-in way to select many icons with a single stroke. When the new
org.nemo.preferences path-selection-enabled key is true, pressing the right
mouse button on an empty area of an icon view (or the desktop) and dragging
draws a path, and every icon the path enters is toggled.

Behaviour

  • Off by default. A right-click on an icon, or a right-click without dragging,
    behaves exactly as before, including right-button drag and drop.
  • First pass over an icon selects it, the next pass deselects it, and so on.
    Toggling happens when the path enters an icon, with a small exit margin so
    hand jitter on an icon's edge does not toggle it twice.
  • The path is sampled every few pixels, so fast strokes cannot skip icons.
  • The stroke is drawn in the theme's selection colour and follows scrolling.

Implementation

  • nemo-icon-container.c: new nemo_icon_container_path_select_begin/move/end()
    and nemo_icon_container_is_point_on_icon(). Hit testing reuses
    nemo_icon_canvas_item_hit_test_rectangle() like the rubberband, and a new
    was_inside_path bit in NemoIcon tracks which icons the stroke is inside.
  • nemo-icon-view.c: event handling and drawing of the stroke.
  • org.nemo.gschema.xml / nemo-global-preferences.h: the new key.

Testing

Tested on Linux Mint 22 (Cinnamon, X11, GTK 3.24) on the desktop and in folder
windows (icon view, compact view, several zoom levels), with the key both on
and off. Not tested on Wayland, with several monitors, or with touch input.

Open questions

There is no checkbox in the preferences dialog yet. I'm happy to add one, or to
use a modifier key or another gesture if that fits Nemo better.

…se button

When the new path-selection-enabled preference is on, pressing the right
mouse button on an empty area of an icon view and dragging draws a path.
Every icon the path enters is toggled: the first pass selects it, the next
pass deselects it, and so on. The path is sampled in small steps so fast
strokes cannot skip icons.

A right-click on an icon, or a right-click without dragging, behaves as
before. The preference is off by default.
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