Fix: Prevent Middle Mouse Paste (#7035)
Fixes #7035
Description
This PR fixes an issue where releasing the middle mouse button after panning on Linux causes an unintended paste action due to the system's primary clipboard behavior.
Changes Made
- Updated isMiddleButtonPressed function in blocksuite/affine/shared/src/utils/event.ts to properly detect middle-click for panning vs. pasting.
- Prevented pasting behavior if the middle mouse button was used for panning first.
- Added a check to differentiate between intentional pasting vs. panning release.
- Ensured compatibility across different platforms (Linux, Windows, macOS).
How to use the Graphite Merge Queue
Add either label to this PR to merge it via the merge queue:
- merge - adds this PR to the back of the merge queue
- hotfix - for urgent hot fixes, skip the queue and merge this PR next
You must have a Graphite account in order to use the merge queue. Sign up using this link.
An organization admin has enabled the Graphite Merge Queue in this repository.
Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.
I think this PR can be safely closed and in favor of https://github.com/toeverything/AFFiNE/pull/11496? btw I searched for isMiddleButtonPressed and it seems it is not being used anywhere at all.