Skip to content

Releases: 0xfullex/selection-hook

v2.0.1

23 Mar 11:19
6ba8ac8

Choose a tag to compare

Bug Fixes

Clipboard Backup/Restore: All Formats Support (#8)

Previously, clipboard backup/restore during selection detection only preserved plain text. All other formats (images, HTML, RTF, files, custom app formats) were permanently lost.

Windows:

  • Enumerate and backup all clipboard formats via EnumClipboardFormats
  • Skip synthesized formats (CF_TEXT, CF_BITMAP, etc.) to let Windows re-synthesize on restore
  • Skip unsafe formats (CF_PRIVATEFIRST–CF_PRIVATELAST, CF_OWNERDISPLAY)
  • Special handling for CF_ENHMETAFILE via GetEnhMetaFileBits/SetEnhMetaFileBits

macOS:

  • Backup all pasteboard items and type representations via [item dataForType:]
  • Support multiple pasteboard items (e.g. multi-file copy in Finder)
  • Use NSPasteboardContentsCurrentHostOnly to avoid triggering Universal Clipboard sync on restore

Clipboard Sequence Tracking Fix

  • Windows: Update clipboard_sequence after all RestoreClipboard call sites to prevent false-positive selection reads on subsequent mouse events
  • macOS: Add RestoreClipboard on timeout path (when Cmd+C response is not detected in time) to prevent clipboard data loss

Build Compatibility

  • Replace non-ASCII characters (em-dashes, etc.) in C++ comments with ASCII equivalents to avoid MSVC C4819 warnings on non-Unicode code pages

Documentation

  • Document UIPI limitation for elevated/administrator windows on Windows
  • Document Electron same-process selection limitation (clipboard fallback + --disable-renderer-accessibility deadlock risk)

v2.0.0

22 Mar 14:33

Choose a tag to compare

What's New

Linux Platform Support

  • Full X11 support via XFixes PRIMARY selection monitoring with bidirectional trigger detection
  • Wayland support via wlr-data-control protocol for PRIMARY selection monitoring
  • Wayland compositor cursor position calibration (KDE KWin, GNOME Mutter, Hyprland) with XWayland coordinate normalization
  • Data-control debounce fallback for Wayland environments without input access
  • linuxGetEnvInfo() API for querying display server, compositor, and session details
  • INVALID_COORDINATE (-99999) sentinel for unavailable screen positions
  • Mouse drag suppression to avoid spurious selection change events
  • Right-click early-exit guard for X11

Cross-Platform Improvements

  • Whitespace-only selection filtering (unified IsTrimmedEmpty across all platforms)
  • Native instance creation moved to constructor — config/query methods now available before start()
  • TypeScript exports field and typecheck validation
  • SelectionConfig type definitions aligned with actual implementation

Bug Fixes

  • Windows: Restored key-check polling loop in GetTextViaClipboard; multiple critical fixes
  • macOS: Critical bug fixes from code review
  • Linux: Fixed X11 primary selection detection failures; Wayland IPC coordinate normalization

Developer Experience

  • npm run format command with clang-format enforcement across codebase
  • Comprehensive documentation: API reference, platform guides, usage guide
  • Chinese (zh-CN) documentation translations
  • Linux prebuild support in CI/CD pipeline
  • Beta publishing support with npm dist-tag

Breaking Changes

  • Linux platform added as a supported target (new native dependencies)
  • SelectionConfig interface updated to match actual implementation
  • Event data structure aligned with documentation

v1.0.13

09 Jan 05:56

Choose a tag to compare

What's Changed

  • feat(keyboard): distinguish left and right modifier keys by @zjywill in #12

New Contributors

Full Changelog: v1.0.12...v1.0.13

v1.0.12

08 Sep 09:14

Choose a tag to compare

What's Changed

  • fix(windows): enhance double-click detection by checking window state before selection
  • fix: ignore QUNS_BUSY in ShouldProcessGetSelection by @aooiuu in #10

New Contributors

Full Changelog: v1.0.11...v1.0.12

v1.0.11

20 Aug 14:49

Choose a tag to compare

  • fix(macOS): add type safety for AXAPI calls to prevent crashes

Full Changelog: v1.0.10...v1.0.11

v1.0.10

20 Aug 04:34

Choose a tag to compare

  • fix(macOS): improve validation for selected text range to handle empty strings and ensure valid extraction

Full Changelog: v1.0.9...v1.0.10

v1.0.9

14 Aug 10:33

Choose a tag to compare

  • [Windows] refactor: remove FocusControl method
  • [macOS] fix: validate and adjust selected text range to prevent crashes

Full Changelog: v1.0.8...v1.0.9

v1.0.8

22 Jul 13:14

Choose a tag to compare

  • fix(macOS): shift+click cursor detection
  • fix(Windows): use SetProcessDPIAware instead of SetProcessDpiAwareness when WIndows version is blow 8.1
  • fix(Windows): enhance mouse cursor detection for clipboard mode

Full Changelog: v1.0.7...v1.0.8

v1.0.7

18 Jul 01:07

Choose a tag to compare

  • [macOS] Support macOS 26

Full Changelog: v1.0.6...v1.0.7

v1.0.6

09 Jul 14:44

Choose a tag to compare

  • feat: [macOS] add fullscreen mode detection

Full Changelog: v1.0.5...v1.0.6