Releases: 0xfullex/selection-hook
Releases · 0xfullex/selection-hook
v2.0.1
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
NSPasteboardContentsCurrentHostOnlyto avoid triggering Universal Clipboard sync on restore
Clipboard Sequence Tracking Fix
- Windows: Update
clipboard_sequenceafter allRestoreClipboardcall sites to prevent false-positive selection reads on subsequent mouse events - macOS: Add
RestoreClipboardon 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-accessibilitydeadlock risk)
v2.0.0
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 detailsINVALID_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
IsTrimmedEmptyacross all platforms) - Native instance creation moved to constructor — config/query methods now available before
start() - TypeScript
exportsfield and typecheck validation SelectionConfigtype 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 formatcommand 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)
SelectionConfiginterface updated to match actual implementation- Event data structure aligned with documentation
v1.0.13
v1.0.12
v1.0.11
- fix(macOS): add type safety for AXAPI calls to prevent crashes
Full Changelog: v1.0.10...v1.0.11
v1.0.10
- 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
- [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
- 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
- [macOS] Support macOS 26
Full Changelog: v1.0.6...v1.0.7
v1.0.6
- feat: [macOS] add fullscreen mode detection
Full Changelog: v1.0.5...v1.0.6