Skip to content

Improve clipboard management / Add proper MIME data serialization/handling #13421

@Warchamp7

Description

@Warchamp7

We currently do a lot of weird and direct data juggling for clipboard state which has led to ongoing problems.

/* -------------------------------------
* MARK: - OBSBasic_Clipboard
* -------------------------------------
*/
private:
std::deque<SourceCopyInfo> clipboard;
OBSWeakSourceAutoRelease copyFiltersSource_;
obs_transform_info copiedTransformInfo;
obs_sceneitem_crop copiedCropInfo;
bool hasCopiedTransform = false;
int copySourceTransitionDuration;
OBSWeakSourceAutoRelease copySourceTransition;

Things like storing an actual pointer to a source for the purposes of copying it's data or filters, rather than storing the data itself, has led to the data being wrong/missing at time of paste due to the source in question since being changed or removed.

It has also led to issues when these specialized structs were not updated when new features or data was added to things, leading to copying and pasting a scene item missing some of the data it should have had.

Our handling of copy/paste behaviour should be updated to use proper MIME data types so that we can standardize handling throughout the application. This will mean more consistent behaviour for the clipboard, as well as making it easier to support drag and drop of this data as well.

Anyone interested in pursuing this task should have a strong grasp of code architecture and be familiar with our updated CODESTYLE.

This will mean designing a better set of encapsulated classes such as a clipboard service and serialization layer for OBS object data rather than following prior art. The underlying work should be able to stand on it's own without even being integrated into the UI.


Anyone interested in tackling this project should submit a brief outline for how they intend to implement it, both for approval and for demonstrating an understanding of the goals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ui-uxAnything to do with changes or additions to UI/UX elements.kind/cleanupNon-breaking change which makes code smaller or more readablekind/featureFunctionality or other elements that the project doesn't currently have.kind/tech-debt

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions