[PR #578] Fix system screenshots missing & add support for PNG/JPG formats #558

Open
opened 2026-03-03 01:13:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Clipy/Clipy/pull/578
Author: @pokocat
Created: 1/7/2026
Status: 🔄 Open

Base: developHead: develop


📝 Commits (3)

  • 7bb96bb Fix: Fix issue where system screenshots and multi-format image history are not displayed
  • 3603e24 Chore: Update .gitignore to exclude IDE and generated files
  • a861443 update menu settings

📊 Changes

16 files changed (+852 additions, -1086 deletions)

View changed files

📝 .gitignore (+10 -0)
📝 Clipy.xcodeproj/project.pbxproj (+750 -925)
📝 Clipy.xcodeproj/project.xcworkspace/contents.xcworkspacedata (+1 -1)
Clipy.xcodeproj/xcshareddata/xcschemes/Clipy.xcscheme (+0 -115)
Clipy.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (+0 -8)
📝 Clipy/Sources/AppDelegate.swift (+14 -9)
📝 Clipy/Sources/Extensions/NSImage+Resize.swift (+12 -16)
📝 Clipy/Sources/Extensions/NSPasteboard+Deprecated.swift (+12 -0)
📝 Clipy/Sources/Extensions/Realm+Migration.swift (+26 -1)
📝 Clipy/Sources/Managers/MenuManager.swift (+1 -1)
📝 Clipy/Sources/Models/CPYClipData.swift (+10 -2)
📝 Clipy/Sources/Preferences/Panels/Base.lproj/CPYTypePreferenceViewController.xib (+1 -1)
📝 Clipy/Sources/Preferences/Panels/zh-Hans.lproj/CPYTypePreferenceViewController.strings (+1 -1)
📝 Clipy/Sources/Services/ClipService.swift (+5 -3)
📝 Clipy/Sources/Services/ExcludeAppService.swift (+1 -0)
📝 Clipy/Sources/Services/PasteService.swift (+8 -3)

📄 Description

Summary

This PR restores the missing system screenshot monitoring functionality and significantly improves image clipboard support for modern applications (e.g., IM app, Web Browsers). It also resolves stability issues caused by overly aggressive clipboard polling.

Key Changes

1. Restore System Screenshot Monitoring

  • Re-implemented ScreenShotObserverDelegate in AppDelegate.swift.
  • Replaced the removed RxScreeen dependency with a native delegate implementation, ensuring system screenshots (Cmd+Shift+3/4) are automatically detected and saved to history.

2. Enhanced Image Format Support

  • Added native support for public.png, public.jpeg, and public.tiff pasteboard types.
  • Problem: Previously, Clipy relied on the deprecated NSTIFFPboardType. This caused it to ignore images copied from apps that write modern standard formats (like Chrome "Copy Image" or IM apps).
  • Solution: Updated CPYClipData, MenuManager, and ClipService to recognize these types as valid images and generate thumbnails/titles correctly.

3. Stability & Performance Improvements

  • Fix Polling Interval: Corrected ClipService polling interval from 750 microseconds to 750 milliseconds.
    • Impact: The previous microsecond interval was too aggressive, causing race conditions where Clipy would try to read the clipboard before the writing app finished, resulting in "hit or miss" capture behavior.
  • Improved Deduplication: Updated CPYClipData.hash to include image dimensions (width ^ height).
    • Impact: Prevents different images that happen to have similar data sizes from being incorrectly treated as duplicates and discarded.
  • Robust Thumbnail Generation: Updated NSImage+Resize.swift to add a fallback drawing mechanism when NSBitmapImageRep is nil, ensuring thumbnails are generated for all image types.

Verification

  • System screenshots are now automatically saved to history.
  • Images copied from web browser (PNG/JPG) are correctly saved and displayed.
  • Fixed stability issues where clipboard updates were sometimes missed.
  • Thumbnails are correctly generated for all supported image types.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Clipy/Clipy/pull/578 **Author:** [@pokocat](https://github.com/pokocat) **Created:** 1/7/2026 **Status:** 🔄 Open **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (3) - [`7bb96bb`](https://github.com/Clipy/Clipy/commit/7bb96bbe524b7489acc1a049863358310d6f2a8c) Fix: Fix issue where system screenshots and multi-format image history are not displayed - [`3603e24`](https://github.com/Clipy/Clipy/commit/3603e24eec79a418b536c8b629d2b44f86d876d8) Chore: Update .gitignore to exclude IDE and generated files - [`a861443`](https://github.com/Clipy/Clipy/commit/a861443dc17e6d6ab58ed986e35c16ebd39ee543) update menu settings ### 📊 Changes **16 files changed** (+852 additions, -1086 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+10 -0) 📝 `Clipy.xcodeproj/project.pbxproj` (+750 -925) 📝 `Clipy.xcodeproj/project.xcworkspace/contents.xcworkspacedata` (+1 -1) ➖ `Clipy.xcodeproj/xcshareddata/xcschemes/Clipy.xcscheme` (+0 -115) ➖ `Clipy.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist` (+0 -8) 📝 `Clipy/Sources/AppDelegate.swift` (+14 -9) 📝 `Clipy/Sources/Extensions/NSImage+Resize.swift` (+12 -16) 📝 `Clipy/Sources/Extensions/NSPasteboard+Deprecated.swift` (+12 -0) 📝 `Clipy/Sources/Extensions/Realm+Migration.swift` (+26 -1) 📝 `Clipy/Sources/Managers/MenuManager.swift` (+1 -1) 📝 `Clipy/Sources/Models/CPYClipData.swift` (+10 -2) 📝 `Clipy/Sources/Preferences/Panels/Base.lproj/CPYTypePreferenceViewController.xib` (+1 -1) 📝 `Clipy/Sources/Preferences/Panels/zh-Hans.lproj/CPYTypePreferenceViewController.strings` (+1 -1) 📝 `Clipy/Sources/Services/ClipService.swift` (+5 -3) 📝 `Clipy/Sources/Services/ExcludeAppService.swift` (+1 -0) 📝 `Clipy/Sources/Services/PasteService.swift` (+8 -3) </details> ### 📄 Description ## Summary This PR restores the missing system screenshot monitoring functionality and significantly improves image clipboard support for modern applications (e.g., IM app, Web Browsers). It also resolves stability issues caused by overly aggressive clipboard polling. ## Key Changes ### 1. Restore System Screenshot Monitoring - Re-implemented `ScreenShotObserverDelegate` in `AppDelegate.swift`. - Replaced the removed `RxScreeen` dependency with a native delegate implementation, ensuring system screenshots (Cmd+Shift+3/4) are automatically detected and saved to history. ### 2. Enhanced Image Format Support - Added native support for `public.png`, `public.jpeg`, and `public.tiff` pasteboard types. - **Problem:** Previously, Clipy relied on the deprecated `NSTIFFPboardType`. This caused it to ignore images copied from apps that write modern standard formats (like Chrome "Copy Image" or IM apps). - **Solution:** Updated `CPYClipData`, `MenuManager`, and `ClipService` to recognize these types as valid images and generate thumbnails/titles correctly. ### 3. Stability & Performance Improvements - **Fix Polling Interval:** Corrected `ClipService` polling interval from `750 microseconds` to `750 milliseconds`. - *Impact:* The previous microsecond interval was too aggressive, causing race conditions where Clipy would try to read the clipboard before the writing app finished, resulting in "hit or miss" capture behavior. - **Improved Deduplication:** Updated `CPYClipData.hash` to include image dimensions (`width` ^ `height`). - *Impact:* Prevents different images that happen to have similar data sizes from being incorrectly treated as duplicates and discarded. - **Robust Thumbnail Generation:** Updated `NSImage+Resize.swift` to add a fallback drawing mechanism when `NSBitmapImageRep` is nil, ensuring thumbnails are generated for all image types. ## Verification - [x] System screenshots are now automatically saved to history. - [x] Images copied from web browser (PNG/JPG) are correctly saved and displayed. - [x] Fixed stability issues where clipboard updates were sometimes missed. - [x] Thumbnails are correctly generated for all supported image types. --- --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Clipy#558
No description provided.