-
-
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
X copy/paste buffers, inability to paste with middle-mouse button in gd editor #3030
Comments
should this work on Linux? I can understand for the editor, but for Godot to work like this may make some games work odd on linux.. |
This is X' fault and a very special use case, waiting for Wayland. |
If I remember correctly, the clipboard code doesn't really deal with the "2 Having 2 clipboards is pretty stupid anyway, and in X11 they're not even On 12 December 2015 at 21:30, Stian Furu Øverbye notifications@github.com
|
@punto- The IPC system is smarter than copying the whole clipboard to the window manager. This way there is no overhead when you do ctrl+c or when you select text. The overhead only happens when you do ctrl+v or when you press the middle button. Its no big issue to copy stuff if you copy a small piece of text, but sometimes you want to copy whole files or stuff. @StianTheDark Wayland has currently no support for middle click paste buffers. In fact, it (as protocol) makes the life for wm's and applications even very hard, e.g. you have to think of your own custom MIME type in order to be able to distinguish the selection buffer from the ctrl+c/ctrl+v buffer. And neither weston nor the kde or gnome efforts support middle click pasting, as of now. Or you think of your own custom IPC method to do this, but as long as neither kde nor gnome nor weston support it (nor the toolkits!), one is without hope. |
+1 My fave feature of X is the ability to copy text by highlighting it and paste it with middle click. I find it much more efficient than other methods so I was very disappointed when I discovered this doesn't work under the gd script editor as I use that feature constantly under every other X app. |
Has there been any progress on this? I'm still not able to center-click to paste with Godot 3.1-beta. It's difficult to copy from an urxvt terminal to the Godot editor because it uses Ctrl-C to terminate the running process. Apparently Ctrl+Alt+C or Ctrl+Shift+C will copy to the clipboard, but I only use the keystroke every few years whereas I use the center click dozens of times a day. |
I use this feature everywhere in GNU/Linux where there's a text/edit area. I'd vote for it to be enabled, as a minimum, in the Godot main editor. It's quite a show-stopper when you're used to this. |
The Qt implementation of clipboard has some clarifying notes on the global mouse I've been thinking it could be possible to support in text input fields in editor mode. It doesn't have to touch Godot's clipboard system. Some applications under X11 implement clipboard indexes (also known as Clipboard History) for convenience which is the "real" (Ctrl+c) clipboard - but the middle-mouse uses the X11 global "Selection" buffer which is specifically dedicated to hold selected text from your application - and get pasted into another application window with middle-mouse. So it shouldn't touch the normal system wide clipboard - it's a separate buffer (or "feature") available in X11. Would it be a solution to have code in text input fields in Godot that send the text to the X11 selection buffer upon a selection end - and then (optionally) have them looking for content in said buffer when clicking with middle-mouse in a text input field, only enabled in editor mode to ensure it doesn't break any existing games relying on middle-mouse events? The implementation could sit as a detectable feature of the current clipboard system in Godot (drawing inspiration from the Qt implementation) EDIT |
If anyone care, I now have a working implementation at https://github.com/Larpon/godot/tree/feature/multi-clipboards Selections in TextEdit and LineEdit fields now get reflected in X11 IMPORTANT I thought I'd link it here to let people test it and provide feedback if they want 😃 |
@larpon any updates? do we know if this is coming soon |
@thejacer87 - I'm a bit out of the loop currently. I spoke to "TMM" (irc nick) on IRC a while back and we concluded that he (or someone) had to rewrite the X server integration after 3.2 - and then I could start working on proper support on top of that. The current code need to be rewritten according to TMM. So maybe ask around on IRC? |
@larpon I have updated your patches to make them work with the latest stable branch (3.3.4) For openSUSE Tumbleweed users there is a package available at I've been using it for a few days and it seems to work fine, now the clipboard on Godot behaves like any other application on Linux |
this is in 3.3.4...? i swear i just updated yesterday and it still didn't work. will check again tonight |
@thejacer87 the patches are not merged in official 3.3.4 build, I've only posted my forked repository that contain the clipboard patches |
Note that if you want this feature to be merged, it has to be redone for the |
@ConteZero awesome! Good job 💪 my comment above from April last year is still valid though. I'm unsure if it'll ever reach master in this condition. I hope it will since this is a major UX improvement for users that use the select copy /MM paste all the time. |
Porting the patches to master branch is not straight forward for me:
|
I can confirm it's a huge UX improvement, if you use Linux it's a killer feature, you understand how important it is only when it doesn't work. |
Yes definitely. Many games use MM and Ctrl+C/P for different action input. I can vaguely remember that it'd had to be implemented as a setting for sure, for cases like the mentioned. |
A new property in line_edit and text_edit similar to shortcut_keys_enabled but for the middle mouse button will be enough? |
I'm not sure if this needs to be made optional. People generally expect X11 middle-mouse paste to work in every text field, everywhere. It should also use a clipboard separate from the main (Ctrl + C) clipboard. |
But what about in-game text fields? If you're using the UI in-game, you might not want that behaviour or am I missing something? |
I've ported the patches to master branch |
Same story here 🙁 |
I used a friend's pc to test it and it works so I've done a pull request for master |
Closing in favor of godotengine/godot-proposals#3440, as feature proposals are now tracked on the Godot proposals repository. |
@ConteZero now that this is merged for master, can we please get a 3.4 port, if you have the time. Thank you. |
@FeralBytes I've already done a pull request to backport it to 3.x three weeks ago, is awaiting review |
I am no X expert but I think there are two copy/paste buffers under X.
When I am writing gd code in Godot I cannot copy (via highlighting from xterm) into my gd script by using the middle-mouse button. I looked around and did not see any settings for Godot regarding this.
Did I miss this or is this a feature? I can copy/paste from X apps that use ctrl-c,ctrl-v but I cannot use the other X buffer accessed via highlighting and middle-mouse click.
I tried with git version and 1.1-stable.
The text was updated successfully, but these errors were encountered: