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

Added primary clipboard for Linux #53702

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

ConteZero
Copy link
Contributor

@ConteZero ConteZero commented Oct 12, 2021

This commit add support for primary clipboard on Linux to handle text paste with middle mouse button.
It should solve #3030

This is based on code originally written by @larpon, I fixed some bugs, added small improvements and updated the code to make it work with current master branch.

Bugsquad edit: Fixes godotengine/godot-proposals#3440.

Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

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

Can't comment on DisplayServer side, but overall looks okay.

One other thing to note, we should probably move the paste blocks into a method something like paste_primary_clipboard(). Then for TextEdit allow it to be overridden similar to paste().

scene/gui/text_edit.cpp Outdated Show resolved Hide resolved
scene/gui/text_edit.cpp Outdated Show resolved Hide resolved
scene/gui/text_edit.cpp Outdated Show resolved Hide resolved
scene/gui/line_edit.cpp Outdated Show resolved Hide resolved
scene/gui/line_edit.cpp Outdated Show resolved Hide resolved
scene/gui/text_edit.cpp Outdated Show resolved Hide resolved
@ConteZero ConteZero force-pushed the primary_clipboard_linux branch 5 times, most recently from c1f6470 to 8098535 Compare October 15, 2021 20:53
@ConteZero
Copy link
Contributor Author

@Paulb23 I've done some changes in how primary clipboard selection is handled to solve a bug in the previous code.

doc/classes/DisplayServer.xml Outdated Show resolved Hide resolved
scene/gui/text_edit.h Outdated Show resolved Hide resolved
scene/gui/text_edit.cpp Outdated Show resolved Hide resolved
scene/gui/text_edit.cpp Show resolved Hide resolved
scene/gui/text_edit.cpp Outdated Show resolved Hide resolved
@ConteZero
Copy link
Contributor Author

@Paulb23 I've also added a missing update() in rich_text_label

Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

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

GUI changes LGTM.

@ConteZero
Copy link
Contributor Author

I would like to send a pull request for the 3.x branch to backport this feature, can I do it or should I wait for this one to be merged?

@Calinou
Copy link
Member

Calinou commented Oct 20, 2021

I would like to send a pull request for the 3.x branch to backport this feature, can I do it or should I wait for this one to be merged?

You can open a 3.x version of this pull request now if you wish 🙂

@akien-mga akien-mga merged commit 8748247 into godotengine:master Oct 20, 2021
@akien-mga
Copy link
Member

akien-mga commented Oct 20, 2021

Thanks! And congrats for your first merged Godot contribution 🎉

@larpon
Copy link
Contributor

larpon commented Oct 20, 2021

@ConteZero good job! Thanks for picking it up again 🤘🔥💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement middle-clicking to paste with primary clipboard in X11
5 participants