dsh-top-drag: Coexistence of Top-Drag and Click on Windows Desktop

Preface

In DSH Desktop (Windows), the top ~36 pixels of the window form a self-drawn drag strip. The session title, sub-agent buttons, and some toolbars drawn by plugins at the top are stacked beneath this strip. Because the drag strip is on the topmost layer and intercepts clicks first, you may experience “an unclickable area at the very top,” and adding -webkit-app-region: no-drag to buttons does not help. Simply narrowing the drag region makes the window harder to drag. The dsh-top-drag described below is a DSH Desktop client plugin maintained by Mo3ter (Windows only) that introduces a “measurement band” to yield space by pixel columns between dragging and clicking, without changing the application layout or requiring each plugin to adapt individually.

What is this

dsh-top-drag targets the desktop preload-injected #dsh-desktop-windows-drag-region overlay: while preserving the semantic of the full 36px strip, it divides the top area into multiple columns. Columns that contain clickable UI yield to clicks; empty columns remain draggable. In DSH Web or CLI Harness, the script checks the platform first and stays dormant, doing nothing.

What problem it fixes

Under Windows, DSH Desktop uses a fixed-position drag overlay (height 36px, -webkit-app-region: drag) and pulls sidebar and session header content up, with the title row drawn beneath the overlay starting at y = 6. As a result:

  • The topmost interactive region of the window does not respond to clicks
  • The session title, breadcrumbs, and sub-agent buttons cannot be clicked
  • Plugins that draw UI at the top (e.g., memory plugins’ toolbars) are also blocked

This plugin does not delete the overlay as a fallback: it hides the original overlay only after the measurement band is ready; on script errors it still reverts to the official shipped behavior.

Core mechanism

  1. Zero layout changes
    No padding is added or removed, and no page patching occurs; new plugin UI installed at the top automatically avoids overlap based on geometric measurements.

  2. 16-column strips
    By default, the top band is cut into 16 small cells (COLUMNS). Each cell only observes its own vertical strip:
    - If a clickable element exists (button, a[href], form controls, as well as nodes covered by selectors like role, tabindex, aria-label, etc.) → that cell shrinks to the top edge of the element, click priority
    - If there are no candidates in that strip → keep the full 36px band, drag priority

  3. Clickability detection
    One querySelectorAll plus getBoundingClientRect for each candidate, without per-point hit testing, and intentionally avoiding MutationObserver (to prevent frequent triggers during chat streaming).

  4. Dialogs
    When dialog[open], [role=dialog], or [aria-modal=true] exists, the entire measurement band yields, letting modal dialogs take clicks.

  5. Cost
    On-demand measurement, no polling. Triggers include: pointer entering within 44px of the top, switching main panels, window resizing, manual dsh-top-band-rescan events, and a fallback about every 10 seconds; the minimum interval between scans is 700ms (MIN_GAP_MS). The README reports that in long sessions a single scan takes about the 4ms range.

Installation and activation

The plugin runs with the current DSH process privileges; before installing, it is recommended to review lib/index.js and the license.

Install from GitHub (as in the original README):

dsh plugin add github:Mo3ter/dsh-top-drag

Other methods documented in the README:

dsh plugin add dsh-top-drag
dsh plugin add file:./dsh-top-drag

Once the plugin is published to the marketplace, one-click installation is also available (subject to the directory page).
Host-level plugins require a Harness restart; DSH Desktop loads it on next launch. The current package version is 1.7.1, requiring Node >= 20.

Typical usage and tuning

No configuration is needed day-to-day: just install and it works. If drag/click regions do not update promptly after changes to the top UI, trigger a rescan from the console or your own script:

window.dispatchEvent(new Event('dsh-top-band-rescan'));

Adjustable constants are located at the top of lib/index.js:

Constant Meaning
COLUMNS Number of measurement-band cells (default 16)
STRIP Band height in pixels (default 36)
PILL_* A small hint handle drawn when the middle column is idle
MIN_GAP_MS Minimum interval between two scans (default 700)
SAFETY_TICK_MS Fallback timer (default 10000)

The Chinese README also mentions SELECTOR; refer to the current repository lib/index.js for authoritative content.

Uninstall:

dsh plugin remove dsh-top-drag

Or remove the corresponding line from the profile’s cordis.patch.yml; the README notes that it will not write files outside the profile.

Use cases and caveats

Suitable for: Users on Windows using DSH Desktop who need to click the top session header, sub-agent entry, or plugin toolbars while still wanting to drag the window from the title area.

Notes:

  • Windows only, and it depends on preload overlay id and conventions like dsh-desktop-windows-titlebar-layout. If Desktop changes related implementations in the future, the plugin may remain dormant or stop working; the README states it is designed not to break dragging.
  • No telemetry, no network access; the whole package is a single host file that injects one <style> and one <script> line into index.html via webserver/index-inject.
  • SkillHub etc. are community directories and have no official affiliation with DeepSeek / Huan. Stars and such are as shown at the time on each site.

Conclusion

dsh-top-drag replaces “a drag overlay covering the entire top” with a measurement band that yields by column geometry. Without substantially altering the DSH Desktop layout, it alleviates the issue where top UI cannot be clicked on Windows. To learn more and install:

  • Directory page: https://www.skillhub.cn/plugins/Mo3ter/dsh-top-drag
  • GitHub: https://github.com/Mo3ter/dsh-top-drag
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye