When i try to use ClearClipboard() SetClipboard(#CLIPBOARD_TEXT, string$) on x64 Linux (Ubuntu) i got the Error: Failed to open clipboard.
Systemwide Clipboard in Linux is working (Copy and Paste).
x64 Linux (Ubuntu): Failed to open clipboard
- airsoftsoftwair
- Posts: 5856
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: x64 Linux (Ubuntu): Failed to open clipboard
Tried your script on Ubuntu 20.04 and it worked correctly. No error. What is your Ubuntu version?
Re: x64 Linux (Ubuntu): Failed to open clipboard
Hi!
Is there already a solution?
I have the same problem here, Kernel: Linux 6.18.2-2-cachyos-deckify.
Is there already a solution?
I have the same problem here, Kernel: Linux 6.18.2-2-cachyos-deckify.
- airsoftsoftwair
- Posts: 5856
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: x64 Linux (Ubuntu): Failed to open clipboard
As I said, I'm not able to reproduce the problem here. Can you point me at a Linux distribution that I can use to reproduce the issue? Preferably a distribution that is available as a live image that can be run from a USB stick...
Re: x64 Linux (Ubuntu): Failed to open clipboard
Hi Andreas!
I used this distribution https://cachyos.org/download/ (Handheld Edition).
They can load an image there, and the problem can be displayed in this booted distribution.
Today I experimented a bit more.
I compiled the sample code "Clipboard Demo" and it works, no problemeo (wtf?).
However, it always shows that the clipboard is empty.
But if I use a program that is based on Rapagui, there are problems with the clipboard.
Here i compiled my tool deepl for linux. http://nickons.org/pb/deepl
and here some code snipes..
Merry Christmas!!
I used this distribution https://cachyos.org/download/ (Handheld Edition).
They can load an image there, and the problem can be displayed in this booted distribution.
Today I experimented a bit more.
I compiled the sample code "Clipboard Demo" and it works, no problemeo (wtf?).
However, it always shows that the clipboard is empty.
But if I use a program that is based on Rapagui, there are problems with the clipboard.
Here i compiled my tool deepl for linux. http://nickons.org/pb/deepl
and here some code snipes..
Code: Select all
/* Schiebt den uebersetzten Text in die Zwischenablage */
Function p_copy()
text$ = moai.Get("t_output","text")
If StrLen(text$) > 0
pos1$, pos2$ = moai.DoMethod("t_output","GetSelection")
If pos1$ = -1
SetClipboard(#CLIPBOARD_TEXT,text$) ; kopiert alles
Else
SetClipboard(#CLIPBOARD_TEXT,MidStr(text$,pos1$,pos2$-pos1$)) ; kopiert nur markierten Bereich
EndIf
EndIf
EndFunction
/* Fuegt die Zwischenablage als Source Text ein */
Function p_paste()
If PeekClipboard() = #CLIPBOARD_TEXT
moai.DoMethod("t_input","Clear")
type$, text$ = GetClipboard()
moai.Set("t_input","text",text$)
moai.Set("t_input","CursorPos",StrLen(text$))
EndIf
EndFunction
Merry Christmas!!
- airsoftsoftwair
- Posts: 5856
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: x64 Linux (Ubuntu): Failed to open clipboard
Thanks, that's the missing piece in the puzzle here. On Linux the clipboard functionality is tied to X11 displays but these aren't there when using RapaGUI because RapaGUI replaces Hollywood's complete display handler. So we need a new way to reroute all clipboard handling through RapaGUI in order to make this work. I've now added a new interface specifically for this to the Hollywood SDK so the next version of RapaGUI can hopefully support this.
Code: Select all
- New [SDK]: Added support for clipboard adapter plugins; if a plugin has the HWPLUG_CAPS_CLIPBOARDADAPTER
capability bit set, it can override all of Hollywood's inbuilt clipboard functions and re-implement them
using custom ones
Re: x64 Linux (Ubuntu): Failed to open clipboard
Thanks for the quick reply and a happy new year!
