GHOST/Wayland: copy & paste image to clipboard support

Adds copy and paste images functionality to and from the image editor
in Linux/Wayland clipboard.

Currently the only format supported is PNG.

Ref: !119117
This commit is contained in:
Jose Vicente Barrachina
2024-03-12 17:34:03 +11:00
committed by Campbell Barton
parent fff99c2e62
commit 692de6d380
3 changed files with 176 additions and 3 deletions
+9
View File
@@ -211,7 +211,16 @@ class IMAGE_MT_image(Menu):
layout.separator()
has_image_clipboard = False
if sys.platform[:3] == "win":
has_image_clipboard = True
else:
from _bpy import _ghost_backend
if _ghost_backend() == 'WAYLAND':
has_image_clipboard = True
del _ghost_backend
if has_image_clipboard:
layout.operator("image.clipboard_copy", text="Copy")
layout.operator("image.clipboard_paste", text="Paste")
layout.separator()