Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add primary clipboard support for X11 and wayland #25

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

MoSal
Copy link
Contributor

@MoSal MoSal commented Jan 19, 2024

The X11 code already had the functionality. Just didn't expose it.

 The X11 code already had the functionality. Just didn't expose it.

Signed-off-by: Mohammad AlSaleh <[email protected]>
@MoSal
Copy link
Contributor Author

MoSal commented Jan 19, 2024

PR to add support in iced is ready if this is accepted.

@snaggen
Copy link

snaggen commented Feb 5, 2024

@hecrj would it be possible to get this fix in? I currently have patches for iced and cosmic-term to get support for primary.

Comment on lines +90 to +96
fn read_primary(&self) -> Option<Result<String, Box<dyn Error>>> {
None
}

fn write_primary(&mut self, _contents: String) -> Option<Result<(), Box<dyn Error>>> {
None
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these available only on Linux?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both me and @MoSal created a fix for this, I choose to expose this for unix only, but that is really not very nice to have in the api, since that leaks up all the way through iced to applications trying to use this. So, even if it is more technically correct to only expose this for unix systems, it is much more clean and user friendly with this implementation that have a default implementation that returns None on systems without primary.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough!

Copy link
Owner

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hecrj hecrj merged commit ba5cd2a into hecrj:master Feb 7, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants