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

[Wayland GTK] Pasting text copied from Wayland app doesn't work before you copy something from Cuda or a Xwayland app #5003

Open
pintassilgo opened this issue Apr 18, 2023 · 4 comments

Comments

@pintassilgo
Copy link

pintassilgo commented Apr 18, 2023

Qt5 build has some bugs, so I'm intending to use GTK instead, but GTK version also has this one bug.

Under a Wayland session, open GTK CudaText. Copy something from a Wayland app (I'm supposing you know how to check if an app is running as native Wayland or Xwayland). Try to paste it in Cuda. Nothing happens.

After you copy something from Cuda, the bug is suddenly fixed, so now you can copy again from the Wayland app and pasting to Cuda works.

Other way to "fix" the bug is by copying once from a Xwayland app. Example:

  1. You're running a Wayland session, not X11.
  2. Open Cuda.
  3. Copy something from Kate editor (Wayland app).
  4. Try to paste in Cuda. It doesn't work.
  5. Open SciTE editor using env var GDK_BACKEND=x11 so that it runs as Xwayland.
  6. Copy something from SciTE.
  7. Repeat 3 (copy from Kate).
  8. Paste in Cuda. Now it works!

As you noticed, step 6 (copy something from Xwayland while Cuda is open) is what fixes the issue for some reason. Copy something from Cuda itself is another other way to "fix" the issue.

Kate and SciTE were mentioned as examples. It could be any native Wayland app instead of Kate and any app running as Xwayland instead of SciTE. In fact, I noticed this bug when I tried to copy from Firefox (Wayland) right after launching Cuda. You can check if Firefox is running Wayland or Xwayland by opening about:support and checking if "Window Protocol" shows "Wayland" or "xwayland".

@Alexey-T
Copy link
Owner

Ops, sorry, installing the Lazarus is too much, don't do it. instead you can report these 2 issues to the Lazarus bugtracker, using my demo app: it has 2 build-modes: gtk2 and qt5.

Source:
tst-synedit.zip

gtk2/qt5 binaries for your test:
tst-synedit-binaries.zip

@pintassilgo
Copy link
Author

This is issue of GTK2 widgetset in Lazarus. The best is to report the same - but now about Lazarus IDE - to the Lazarus bugtracker.
Here:
https://gitlab.com/groups/freepascal.org/lazarus/-/issues
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues

GitLab can handle your Github login.

Pls specify in both your reports that you checked this issue on the latest Lazarus build which you can install from fpcUpDeluxe by 2-3 clicks. In fpcupDeluxe program, check the version named 'trunk' - the latest. FPC can be checked as 'release', but Lazarus should be 'trunk'.

Thanks. Reported here:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40219

But I don't know if I'm the right person to do it because I don't know anything about Lazarus, I'm just a CudaText user who found a bug.

@pintassilgo
Copy link
Author

pintassilgo commented May 4, 2023

New info: this issue is, somehow, passed in session store (or python cache? I don't know).

I use Qt5 Cuda, but I have the GTK bin alongside, in the same folder, renamed to cudatextgtk when I need to test bugs on it.

I said this issue here only affects Cuda GTK, but I just noticed it's actually a bit different: the issue is caused by launching Cuda GTK in the previous session.

If this is hard to understand, I'll give examples:

  • If I always use Cuda Qt5, pasting always works (no issue).
  • The first time I open Cuda GTK after using Cuda Qt5, pasting text copied from a Wayland app works from the start (i.e. the issue doesn't happen).
  • The first time I open Cuda after using Cuda GTK, I can see the issue even in Cuda Qt5.

So, somehow, launching Cuda GTK makes the next Cuda launch (no matter if Qt5 or GTK) affected by this bug.

@pintassilgo
Copy link
Author

pintassilgo commented May 4, 2023

I did many tests trying to isolate the issue... Deleted settings folder, deleted all __pycache__ folders in py folder, deleted py folder... Nothing affected what I described in my previous comment.

So it's not something stored in any file by CudaText.

My only guess now is that is something stored in system memory cache (RAM).

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

No branches or pull requests

2 participants