Skip to content

About

Prototype for Right-Click Drag (Brush) Selection in Linux Mint's Nemo File Manager

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Linux mint Nemo Freeform Path Selection

Developed by: Yazeed Ali Al-Ghamdi

Overview

This is a working prototype developed by Yazeed Ali Al-Ghamdi that adds Freeform Path Selection (Brush Selection) to the Nemo File Manager in Linux Mint. Instead of relying solely on the traditional box selection, users can now right-click and drag to draw a freeform path, intuitively selecting any file the path intersects.

I built this feature to solve a long-standing workflow limitation, hoping it helps the Linux community!

How it works (Under the Hood)

I modified src/nemo-icon-view.c to hook into pointer motion and button events without breaking core functionalities:

  1. Smart Timeout: Right-clicking initiates a g_timeout_add suspension. If released immediately without moving, the standard context menu pops up. If dragged (>10 pixels), path selection mode is activated.
  2. Cairo Visual Feedback: Mouse movement coordinates are stored in a GArray and drawn using cairo_t, dynamically pulling theme_selected_bg_color for a native look.
  3. Synthetic Event Injection: Bypassing standard external selection barriers, the code injects synthetic GDK_BUTTON_PRESS events (GDK_CONTROL_MASK + send_event = FALSE) to programmatically select files under the cursor path.
  4. Spatial Hashing (Anti-Toggle Mechanism): Since Ctrl+Click toggles selections, moving the cursor slowly would naturally deselect items. I solved this by implementing a "Spatial Memory" array that checks the squared distance (< 2025.0 or ~45px) against all previously clicked points in the current stroke, ignoring duplicate synthetic clicks within that radius.

Installation / Testing

You can apply the attached .patch file directly to the Nemo source code: git am 0001-Feature-Add-right-click-freeform-path-selection.patch

Looking forward to the Linux Mint community and core devs reviewing this concept, polishing it, and hopefully merging it into the official release. If you find this helpful, prayers and good wishes are highly appreciated!

About

Prototype for Right-Click Drag (Brush) Selection in Linux Mint's Nemo File Manager

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages