Switch to Wayland with side effect to Clipboard

Post

Posted
Rating:
#1 (In Topic #967)
Regular
01McAc is in the usergroup ‘Regular’
Since I switched from X11 to Wayland the Clipboard command does not work anymore:

Code (gambas)

  1. Clipboard.Copy(myCam & " +" & str_myLens, "text/plain")
Any idea what's wrong with this?
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’

01McAc said

Since I switched from X11 to Wayland the Clipboard command does not work anymore:

Code (gambas)

  1. Clipboard.Copy(myCam & " +" & str_myLens, "text/plain")
Any idea what's wrong with this?

It's Wayland.
Loads of stuff does not work with wayland

I'd switch back to x11 if you want decent "has worked for years" tried and tested functionality.

If you want a restricted/limited/incomplete os , go for wayland.

Could be worth trying to use a different toolkit.
Ie. gb-qt5-wayland might work better than gb-gtk-wayland
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
 It sounds like it could be a bug though.
Maybe get on the BugTracker and report it.
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
 maybe you could install
wl-clipboard command?
Online now: No Back to the top

Post

Posted
Rating:
#5
Regular
01McAc is in the usergroup ‘Regular’

BruceSteers said

maybe you could install
wl-clipboard command?
Thanks Bruce. I installed wl-clipboard to follow up on this but it doesn't help unfortunately. Since you mentioned gb-qt5-wayland I checked its status on my system:

Code (gambas)

  1. dnf list \*gambas\*wayland\*
  2. Last metadata expiration check: 0:26:49 ago on Wed 28 Dec 2022 10:10:41 CET.
  3. Installed Packages
  4. gambas3-gb-gtk3-wayland.x86_64                                         3.17.3-5.fc38                                          @rawhide
  5. gambas3-gb-qt5-wayland.x86_64                                          3.17.3-5.fc38                                          @rawhide

Both wayland components gtk3 and qt5 are installed. But when I open the Gambas project settings I cannot find any wayland components. Do I have to enable them somewhere?
Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
I think you just use gb.gtk or gb.qt5 component
the wayland switching part is handled by gambas.

so to use gb-qt5-wayland just use gb.qt5

I tried to help by installing wayland plasma-desktop on my laptop here but it was completely unusable.
i could not get any menus to open via mouse click, (not just gambas, everywhere)
I could not type text in the gambas IDE as the font changes size on editing a line and the cursor gets miss positioned.
It changed my language/keyboard from GB to US!
What a mess !!
Like i say if you can install an x11 version of whatever desktop you are using i'd recommend doing so and removing wayland completely
(like i just did ;) ).

Not only is wayland rubbish but also gambas does not support it very well yet.
You have to understand the GUI system in gambas.
It is full of features/functions that when coded will operate the same for the gtk or qt toolkits.
Then comes wayland and there are many things that cannot be done, or work very differently.
So to get the best from gambas use x11 not wayland.
Wayland is still usable with gambas you will just find many problems with some features/functions not working as expected.
Like moving windows via code, using Clipboard, many other things.
Online now: No Back to the top

Post

Posted
Rating:
#7
Regular
01McAc is in the usergroup ‘Regular’
Wayland- 'good things come to those who wait'. It seems I still have to wait a while to use Wayland. But to be fair I have to admit that wayland is faster and more responsive than X11. Even the wobbly windows are working perfectly  :D . At the moment there are two points that prevent me from using it permanently: the way how it works with Gambas and Zoom doesn't work at all with wayand.
My display manager gdm shows the option to start KDE with X11 or Wayland so the choice is up to me.
Online now: No Back to the top

Post

Posted
Rating:
#8
Guru
BruceSteers is in the usergroup ‘Guru’

01McAc said

BruceSteers said

maybe you could install
wl-clipboard command?
Thanks Bruce. I installed wl-clipboard to follow up on this but it doesn't help unfortunately. Since you mentioned gb-qt5-wayland I checked its status on my system:

Really?

Can you not do something like this…

Code (gambas)

  1.  
  2. If Desktop.Platform = "wayland" Then
  3.   Exec ["wl-copy", "-p", "-t", "text/plain", myCam & " +" & str_myLens]
  4.   Clipboard.Copy(myCam & " +" & str_myLens, "text/plain")
  5.  
  6.  
Note: i used the -p flag to use primary clipboard.
Check out the wl-copy help for other options you may want/need

Code

wl-copy --help
Usage:
   wl-copy [options] text to copy
   wl-copy [options] < file-to-copy

Copy content to the Wayland clipboard.

Options:
   -o, --paste-once   Only serve one paste request and then exit.
   -f, --foreground   Stay in the foreground instead of forking.
   -c, --clear      Instead of copying anything, clear the clipboard.
   -p, --primary      Use the "primary" clipboard.
   -n, --trim-newline   Do not copy the trailing newline character.
   -t, --type mime/type   Override the inferred MIME type for the content.
   -s, --seat seat-name   Pick the seat to work with.
   -v, --version      Display version info.
   -h, --help      Display this message.
Mandatory arguments to long options are mandatory for short options too.
Online now: No Back to the top

Post

Posted
Rating:
#9
Guru
BruceSteers is in the usergroup ‘Guru’
 also do any of the clipboard managers run on wayland? like clipman / clipit / diodon / etc
if any of them work you could use their shell commands to add text to the clipboard.

(pretty sure clipman is for wayland)
Online now: No Back to the top

Post

Posted
Rating:
#10
Regular
01McAc is in the usergroup ‘Regular’
Thanks for the reply. Solved finally!
It is very interesting, that the exec command doesn't work either.

Code (gambas)

  1.     ...
  2.     Exec ["wl-copy", "-p", "-t", "text/plain", myCam & " +" & str_myLens]
  3.      ...
  4.  

So I tried instead of Exec the Shell command. I found out the Shell command only works with this options on my desktop.

Code (gambas)

  1. Shell "wl-copy -t text/plain" & myCam & "  " & myLensString Wait

Thank you again for the help and your patient. Happy new year and a very good start into year 2023.
Online now: No Back to the top
1 guest and 0 members have just viewed this.