-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[3.x] Added primary clipboard for Linux #54026
[3.x] Added primary clipboard for Linux #54026
Conversation
30a0cbb
to
fe9e75f
Compare
fe9e75f
to
499d9a5
Compare
This should also include changes from follow up PRs (at least #54045, I didn't check if there was any other), otherwise it will exhibit the same issues. |
3.x branch does not have |
71cb8d3
to
c58391c
Compare
499d9a5
to
528a07e
Compare
There is The command line is pretty long already :)
Unlike diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 7127447f14..4af06351a2 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -3357,7 +3357,17 @@ Error OS_X11::shell_open(String p_uri) {
}
bool OS_X11::_check_internal_feature_support(const String &p_feature) {
- return p_feature == "pc";
+ if (p_feature == "pc") {
+ return true;
+ }
+
+#ifdef __linux__
+ if (p_feature == "primary_clipboard") {
+ return true;
+ }
+#endif
+
+ return false;
}
String OS_X11::get_config_path() const { That's assuming that primary clipboard is a Linux-only feature and not something provided by *BSD systems too. Otherwise, you could then indeed just rely on the already existing |
528a07e
to
b4b8f62
Compare
I've removed the DEFINE |
I'm still not sure why it's Linux specific though, as opposed to X11 specific. The implementation for primary clipboard doesn't make a distinction between GNU/Linux and FreeBSD/OpenBSD/NetBSD. To clarify, the platform is called |
I can only test on Linux so I really don't know if the primary clipboard code works on *BSD. |
Searching "OpenBSD X11 primary clipboard" gives a number of results which seem to infer that it does work. If it doesn't work, the X11 API would return an error and hopefully we already handle it gracefully anyway. |
b4b8f62
to
2ff0735
Compare
OK, I've removed the #ifdef |
Thanks! |
This commit add support for primary clipboard on Linux to handle text paste with middle mouse button.
This is a backport of #53702 to 3.x branch.