Clipboard inconsistencies when copy-pasting text #97245

Open
opened 2022-04-11 13:26:26 +02:00 by Demeter Dzadik · 6 comments
Member

System Information
Operating system: Linux-5.16.15-76051615-generic-x86_64-with-glibc2.34 64 Bits
Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.86

Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-04-08 09:27, hash: a410cea291

Short-ish description of error

@ZedDB explained to me that, at least on Linux, there are two OS clipboards (and I might be inaccurate on the details here, feel free to correct):

  • Ctrl+C -> Ctrl+V on a selection, the one we're all familiar with.
  • The 2nd clipboard is filled with the user's last text selection, and pasted with Middle Mouse Button or Shift+Insert.
  • Additionally, we have a Blender clipboard, accessible from the PyAPI via context.window_manager.clipboard. From what I've tested, pressing Ctrl+C always behaves the same as setting this.

The way copying and pasting works from Blender into other running applications seems to be inconsistent, depending on the target application and which one of the copy-pasting methods are used.

Some use case examples, if that's needed:

  1. Pasting quick scripts from Text Editor/PyConsole into a chat application (quick scripts for artists).
  2. Making an operator in an add-on that can put an error message on the user's clipboard, to aid troubleshooting errors.

Situation on popOS

I expect these issues to have some variation across different systems, so if you have a different system and get different results, please post them.

The inconsistencies I found, sorted in my personal priority:

  • Ctrl+C -> Ctrl+V from Blender Text Editor and Properties works to VSC, but not to Firefox.
  • Ctrl+C -> Ctrl+V does work from one Blender instance to another ONLY IF the source Blender instance is not closed.
  • Selection -> Middle Mouse Paste works from Blender Text Editor to other software, UNLESS using the Ctrl+A "Select All" shortcut in the text editor.
  • Selection -> Middle Mouse Paste does not work from one Blender Text Editor to another.
  • Selection -> Middle Mouse Paste does not work from Blender Properties to anywhere else.
**System Information** Operating system: Linux-5.16.15-76051615-generic-x86_64-with-glibc2.34 64 Bits Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.86 **Blender Version** Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-04-08 09:27, hash: `a410cea291` ### Short-ish description of error @ZedDB explained to me that, at least on Linux, there are two OS clipboards (and I might be inaccurate on the details here, feel free to correct): - Ctrl+C -> Ctrl+V on a selection, the one we're all familiar with. - The 2nd clipboard is filled with the user's last text selection, and pasted with Middle Mouse Button or Shift+Insert. - Additionally, we have a Blender clipboard, accessible from the PyAPI via `context.window_manager.clipboard`. From what I've tested, pressing Ctrl+C always behaves the same as setting this. The way copying and pasting works from Blender into other running applications seems to be inconsistent, depending on the target application and which one of the copy-pasting methods are used. **Some use case examples, if that's needed**: 1) Pasting quick scripts from Text Editor/PyConsole into a chat application (quick scripts for artists). 2) Making an operator in an add-on that can put an error message on the user's clipboard, to aid troubleshooting errors. ### Situation on popOS I expect these issues to have some variation across different systems, so if you have a different system and get different results, please post them. The inconsistencies I found, sorted in my personal priority: - Ctrl+C -> Ctrl+V from Blender Text Editor and Properties works to VSC, but not to Firefox. - Ctrl+C -> Ctrl+V does work from one Blender instance to another ONLY IF the source Blender instance is not closed. - Selection -> Middle Mouse Paste works from Blender Text Editor to other software, UNLESS using the Ctrl+A "Select All" shortcut in the text editor. - Selection -> Middle Mouse Paste does not work from one Blender Text Editor to another. - Selection -> Middle Mouse Paste does not work from Blender Properties to anywhere else.
Author
Member

Added subscribers: @ZedDB, @Mets

Added subscribers: @ZedDB, @Mets
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Some of the issue you mention are due to limitations of display servers themselves, for instance, if the Blender instance you copied from is terminated, you will not be able to paste because X11 doesn't keep a copy of the copied contents, only a reference to it, where the actual data was held by the terminated Blender instance. You can work around those issue by using a clipboard manager, however. See https://wiki.archlinux.org/title/clipboard.
Not sure about the other issue.

Some of the issue you mention are due to limitations of display servers themselves, for instance, if the Blender instance you copied from is terminated, you will not be able to paste because X11 doesn't keep a copy of the copied contents, only a reference to it, where the actual data was held by the terminated Blender instance. You can work around those issue by using a clipboard manager, however. See https://wiki.archlinux.org/title/clipboard. Not sure about the other issue.
Author
Member

Yes, it's worth mentioning that there also exist copy pasting issues when it comes to quitting Blender, but I was already aware that that's a known issue, so note that none of the inconsistent behaviours I listed here require quitting Blender.

Yes, it's worth mentioning that there also exist copy pasting issues when it comes to quitting Blender, but I was already aware that that's a known issue, so note that none of the inconsistent behaviours I listed here require quitting Blender.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I can replicate all of the selection clipboard issues. As far as I can see in the code, it seems the appropriate copy to clipboard WM functions are not called in all operators related to selection, so I guess a fix shouldn't be too hard.

I can replicate all of the selection clipboard issues. As far as I can see in the code, it seems the appropriate copy to clipboard WM functions are not called in all operators related to selection, so I guess a fix shouldn't be too hard.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
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: blender/blender#97245
No description provided.