diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 98056479fb3..2f426b4653a 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -102,6 +102,10 @@ typedef enum { * Support for reading the front-buffer. */ GHOST_kCapabilityGPUReadFrontBuffer = (1 << 3), + /** + * Set when there is support for system clipboard copy/paste. + */ + GHOST_kCapabilityClipboardImages = (1 << 4), } GHOST_TCapabilityFlag; /** diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 049d9effbb3..5a6f916e1dd 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -903,7 +903,9 @@ GHOST_TCapabilityFlag GHOST_SystemCocoa::getCapabilities() const return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL & ~( /* Cocoa has no support for a primary selection clipboard. */ - GHOST_kCapabilityPrimaryClipboard)); + GHOST_kCapabilityPrimaryClipboard | + /* This Cocoa back-end has not yet implemented image copy/paste. */ + GHOST_kCapabilityClipboardImages)); } #pragma mark Event handlers diff --git a/intern/ghost/intern/GHOST_SystemHeadless.hh b/intern/ghost/intern/GHOST_SystemHeadless.hh index feefbe264d6..a77a5c6349c 100644 --- a/intern/ghost/intern/GHOST_SystemHeadless.hh +++ b/intern/ghost/intern/GHOST_SystemHeadless.hh @@ -47,7 +47,8 @@ class GHOST_SystemHeadless : public GHOST_System { return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL & /* No windowing functionality supported. */ ~(GHOST_kCapabilityWindowPosition | GHOST_kCapabilityCursorWarp | - GHOST_kCapabilityPrimaryClipboard)); + GHOST_kCapabilityPrimaryClipboard | + GHOST_kCapabilityClipboardImages)); } char *getClipboard(bool /*selection*/) const override { diff --git a/intern/ghost/intern/GHOST_SystemSDL.cc b/intern/ghost/intern/GHOST_SystemSDL.cc index b99d2091054..52c222c0d54 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.cc +++ b/intern/ghost/intern/GHOST_SystemSDL.cc @@ -757,7 +757,9 @@ GHOST_TCapabilityFlag GHOST_SystemSDL::getCapabilities() const GHOST_CAPABILITY_FLAG_ALL & ~( /* This SDL back-end has not yet implemented primary clipboard. */ - GHOST_kCapabilityPrimaryClipboard)); + GHOST_kCapabilityPrimaryClipboard | + /* This SDL back-end has not yet implemented image copy/paste. */ + GHOST_kCapabilityClipboardImages)); } char *GHOST_SystemSDL::getClipboard(bool /*selection*/) const diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index be56708997f..a3ddec2aeaf 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -6765,7 +6765,9 @@ GHOST_TCapabilityFlag GHOST_SystemWayland::getCapabilities() const GHOST_kCapabilityCursorWarp | /* Some drivers don't support front-buffer reading, see: #98462 & #106264. * We could inspect the graphics card driver - for now just disable on WAYLAND. */ - GHOST_kCapabilityGPUReadFrontBuffer)); + GHOST_kCapabilityGPUReadFrontBuffer | + /* This WAYLAND back-end has not yet implemented image copy/paste. */ + GHOST_kCapabilityClipboardImages)); } bool GHOST_SystemWayland::cursor_grab_use_software_display_get(const GHOST_TGrabCursorMode mode) diff --git a/intern/ghost/intern/GHOST_SystemX11.cc b/intern/ghost/intern/GHOST_SystemX11.cc index 744204004f2..d5a33b028be 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cc +++ b/intern/ghost/intern/GHOST_SystemX11.cc @@ -1742,7 +1742,10 @@ GHOST_TSuccess GHOST_SystemX11::setCursorPosition(int32_t x, int32_t y) GHOST_TCapabilityFlag GHOST_SystemX11::getCapabilities() const { - return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL); + return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL & + ~( + /* No support yet for image copy/paste. */ + GHOST_kCapabilityClipboardImages)); } void GHOST_SystemX11::addDirtyWindow(GHOST_WindowX11 *bad_wind) diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index dda1a0354b6..621aee5499f 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -138,6 +138,8 @@ typedef enum eWM_CapabilitiesFlag { * Reading from the back-buffer is supported. */ WM_CAPABILITY_GPU_FRONT_BUFFER_READ = (1 << 3), + /** Ability to copy/paste system clipboard images. */ + WM_CAPABILITY_CLIPBOARD_IMAGES = (1 << 4), } eWM_CapabilitiesFlag; eWM_CapabilitiesFlag WM_capabilities_flag(void); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 8f43a72ccd7..a6dfc9cb760 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1852,6 +1852,9 @@ eWM_CapabilitiesFlag WM_capabilities_flag(void) if (ghost_flag & GHOST_kCapabilityGPUReadFrontBuffer) { flag |= WM_CAPABILITY_GPU_FRONT_BUFFER_READ; } + if (ghost_flag & GHOST_kCapabilityClipboardImages) { + flag |= WM_CAPABILITY_CLIPBOARD_IMAGES; + } return flag; }