mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[pycharm] PY-83300 Jupyter: Outputs: allow png copying for new macOS versions
GitOrigin-RevId: d0c443a494dfde94473327a262a1e6115ae7a03b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8188e77d0d
commit
ef526147ef
+5
@@ -6,6 +6,7 @@ package com.intellij.notebooks.visualization.r.inlays
|
||||
|
||||
import com.intellij.openapi.ide.CopyPasteManager
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.util.system.OS
|
||||
import java.awt.Image
|
||||
import java.awt.datatransfer.DataFlavor
|
||||
import java.awt.datatransfer.Transferable
|
||||
@@ -33,6 +34,10 @@ object ClipboardUtils {
|
||||
CopyPasteManager.getInstance().setContents(FileTransferable(listOf(tempImage)))
|
||||
}
|
||||
|
||||
// Standard copy works incorrectly on Mac, see JBR-6788,
|
||||
// But it seemingly was fixed in the newer (15 and later) Mac versions
|
||||
fun isIntermediateFileWorkaroundNeeded(): Boolean = OS.CURRENT == OS.macOS && !OS.CURRENT.isAtLeast(15, 0)
|
||||
|
||||
private class FileTransferable(private val files: List<File>) : Transferable {
|
||||
override fun getTransferDataFlavors(): Array<DataFlavor> = arrayOf(DataFlavor.javaFileListFlavor)
|
||||
override fun isDataFlavorSupported(flavor: DataFlavor): Boolean = DataFlavor.javaFileListFlavor.equals(flavor)
|
||||
|
||||
Reference in New Issue
Block a user