CudaText icon indicating copy to clipboard operation
CudaText copied to clipboard

Qt6 (Flatpak version and regular version): keyboard input doesn't work

Open atarax42 opened this issue 1 year ago • 68 comments

CudaText 1.218.0.2 under Linux Mint 22 Cinnamon, Flatpak installation

When opening a text file with CudaText, keyboard inputs are not detected, text cannot be edited or deleted. Navigating the menu with keyboard shortcuts (e.g. Alt+F) works.

atarax42 avatar Oct 20 '24 07:10 atarax42

I know that Flatpak version can 'eat' key input. But DEB or XZ packages work ok for everybody, AFAIK.

Try DEB packages for Qt5 and Gtk2.

Alexey-T avatar Oct 20 '24 07:10 Alexey-T

That is true, deb works. I changed my report.

atarax42 avatar Oct 20 '24 07:10 atarax42

Can't reproduce, editing a file with the flatpak version works for me, keyboard input works. I'd need more info about the exact situation or environment.

JordanL2 avatar Oct 20 '24 08:10 JordanL2

Can't reproduce, editing a file with the flatpak version works for me, keyboard input works. I'd need more info about the exact situation or environment.

I noticed the same issue on Linux Mint 21 Cinnamon with CudaText 1.218.2.0 installed via Flatpak 1.12.7. CudaText and Flatpak versions may not actually matter as I have always noticed that issue (>1 year).

Exact situation is :

  1. Run flatpak install cudatext,

  2. It asks you to choose between QT or QT5 (EOL) packages - choose the first one.

  3. It asks for various permissions - accept

  4. Run CudaText

  5. CudaText's window appears. But: A. CudaText console contains the following warning:

    NOTE: No Python 3 engine found. Python plugins don't work now. To fix this:
    * write "pylib__linux" to user.json. Read about "pylib" in "Options / Settings-default".
    * or use the menu item "Plugins / Python engine was not found; find it..."
    

    I have tried the following without noticing any change, even after restarting CudaText:

    • use application Flatseal to give permission to CudaText to access /usr/lib/ (in section Filesystem -> Other files)
    • save the following user.json (i confirm /usr/lib/x86_64-linux-gnu/libpython3.10.so.1.0 does exist on the system).
      {
      "pylib__linux" : "/usr/lib/x86_64-linux-gnu/libpython3.10.so.1.0",
      }
      
    • click Plugin -> "Python engine was not found; find it..." and paste /usr/lib/x86_64-linux-gnu/libpython3.10.so.1.0

    B. Inside CudaText's window it is almost as if you had no keyboard. Pressing most keys has not effect. A few have though:

    • if console is displayed, Tab changes focus from text input box to console input box and then to console history (then it remains stuck to the latter).
    • shortcuts like CTRL+C / CTRL+V are not working. However ALT+F, ALT+E, etc. successfully open the contextual menus. When a contextual menu is displayed, you can also use arrows to navigate (whereas arrows won't do anything in the text input box).

In comparison:

  • GTK2 binary for the same CudaText version works great on the same system: no keyboard issue, and no Python warning (it finds Python 3.10.12).
  • I assume GTK2 deb would work as well.
  • QT5 binary fails to open with ./cudatext: error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory
  • QT5 deb (which installs deps libqt5pas-dev & libqt5pas1) fails to open with /usr/bin/cudatext: symbol lookup error: /usr/bin/cudatext: undefined symbol: QGuiApplication_setFallbackSessionManagementEnabled.

Thanks for checking that issue and let us know if you need additional information.

oleole39 avatar Oct 28 '24 23:10 oleole39

sorry for late reply...

QT5 binary fails to open with ./cudatext: error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory

it means that libQt5Pas is not installed. https://wiki.freepascal.org/CudaText#Linux:_Qt5_and_Qt6_builds

QT5 deb (which installs deps libqt5pas-dev & libqt5pas1) fails to open with /usr/bin/cudatext: symbol lookup error: /usr/bin/cudatext: undefined symbol: QGuiApplication_setFallbackSessionManagementEnabled.

it means that libQt5Pas installed but too old version w/o that function support. same wiki link - gives the URL to last version on GIthub.

Alexey-T avatar Dec 14 '24 09:12 Alexey-T

QT5 binary fails to open with ./cudatext: error while loading shared libraries: libQt5Pas.so.1: cannot open shared object file: No such file or directory

it means that libQt5Pas is not installed. https://wiki.freepascal.org/CudaText#Linux:_Qt5_and_Qt6_builds

QT5 deb (which installs deps libqt5pas-dev & libqt5pas1) fails to open with /usr/bin/cudatext: symbol lookup error: /usr/bin/cudatext: undefined symbol: QGuiApplication_setFallbackSessionManagementEnabled.

it means that libQt5Pas installed but too old version w/o that function support. same wiki link - gives the URL to last version on GIthub.

Thanks for your reply. I installed libqt6pas6:amd64 6.2.10 (latest release from the link indicated in the wiki) and made a new test:

  • Deb package (1.220.0.0 QT6) with all suggested dependencies: it opens without errors/warnings, but almost no keyboard control as described in 5.B. in my previous message.
  • Tar.xz archive (1.220.0.0 QT6) : it opens without errors/warnings, but almost no keyboard control as described in in 5.B. in my previous message.
  • Flatpak package (1.219.1.0 QT6): it opens but comes the Python-related warning described in 5.A. of my previous message, and almost no keyboard control as described in 5.B..

oleole39 avatar Dec 16 '24 00:12 oleole39

I posted the 'complain' to the Lazarus forum about Qt6.

Alexey-T avatar Dec 16 '24 03:12 Alexey-T

For reference I just now tried this with flatpak CudaText 1.219.1.0, linux-x86_64-qt6, fpc 3.2.2 on OpenSUSE Leap 15.6 and keyboard input works fine (and I did not have to do any flatseal workarounds for Python).

        ID                                              Branch                Op            Remote             Download
 1. [✓] org.freedesktop.Platform.GL.default             24.08                 u             flathub            960.0 kB / 156.3 MB
 2. [✓] org.freedesktop.Platform.GL.default             24.08extra            u             flathub            960.1 kB / 156.3 MB
 3. [✓] org.freedesktop.Platform.VAAPI.Intel            24.08                 u             flathub              4.3 kB / 14.7 MB
 4. [✓] org.kde.Platform.Locale                         6.8                   i             flathub             18.6 kB / 400.5 MB
 5. [✓] org.kde.Platform                                6.8                   i             flathub            192.9 MB / 370.8 MB
 6. [✓] io.github.cudatext.CudaText-Qt                  stable                i             flathub  

It had to pull in KDE? Which is odd...

On the platforms where this is not working, are they Wayland or X11? I've not tried Wayland.

bogen85 avatar Dec 16 '24 04:12 bogen85

On the platforms where this is not working, are they Wayland or X11? I've not tried Wayland.

Linux Mint 21 Cinnamon uses X11.

It had to pull in KDE? Which is odd...

Flatpak-version of Cudatext uses KDE platform for me too. I guess it is just the base the packager has worked from. How does that sound odd to you?

oleole39 avatar Dec 16 '24 04:12 oleole39

It had to pull in KDE? Which is odd...

Flatpak-version of Cudatext uses KDE platform for me too. I guess it is just the base the packager has worked from. How does that sound odd to you?

Well, outside of flatpak it does not rely on KDE. Yeah, Qt6Pas does require Qt6, but certainly not KDE.

$ for k in 6.6 5.15-21.08 6.8; do flatpak info -rs org.kde.Platform/x86_64/$k; done
runtime/org.kde.Platform/x86_64/6.6 926104576
runtime/org.kde.Platform/x86_64/5.15-21.08 855298048
runtime/org.kde.Platform/x86_64/6.8 1021010432

$ flatpak info -rs io.github.cudatext.CudaText-Qt
app/io.github.cudatext.CudaText-Qt/x86_64/stable 23485952

KDE 6.8:    1021010432
CudaText-Qt:  23485952

CudaTEXT is less than 24MB, but it is odd that it needs a 1GB dependency just for Qt6, as 1GB is larger than an entire Linux OS install that could easily include CudaTEXT and support running it.

bogen85 avatar Dec 16 '24 05:12 bogen85

Well, outside of flatpak it does not rely on KDE. Yeah, Qt6Pas does require Qt6, but certainly not KDE.

Well that is out of topic of the current one, but to what I understand it is meant that way, and yes, that's one of the disadvantages of Flatpak over distribution-specific releases. Flatpak aims at being cross-platform by actually shipping the whole interface block (e.g. KDE, GNOME,...) with the app, which is not optimal in terms of disk use (or even attack surface). Note however that if you use several Flatpak packages that are set to use the same "runtime", the latter is supposed to be installed only once and shared among the various packages (provided it is the same runtime of the exact same version).

Runtimes provide the basic dependencies used by applications. Each application must be built against a runtime, and this runtime must be installed on the host system for the application to run.

https://docs.flatpak.org/en/latest/basic-concepts.html#runtimes

More generally on Flatpak package architecture:

  • Runtime: also called platform, an integrated environment providing basic utilities needed for a Flatpak application to work.
  • BaseApp: an integrated set of additional libraries and frameworks, such as Electron, for Flatpak applications that need more than just the basic runtime.
  • Flatpak bundle: a single-file export format containing a Flatpak application or runtime.

https://docs.flatpak.org/en/latest/introduction.html

If you are not happy with that, you might want to consider the .tar.xz Cudatext release (which requires manual integration) or try converting the deb package into rpm for OpenSuse (they are some scripts for this, but that may not work with all packages).

oleole39 avatar Dec 16 '24 14:12 oleole39

Linux Mint 22, KDE Plasma, -> flatpak install cudatext, choosen 1st option, so Qt6, started cudatext , keyboard works ok. Edit: x11, not wayland

zeljan1 avatar Jan 02 '25 19:01 zeljan1

In the meantime tested on: Cinnamon (default), Gnome Classic wayland, Gnome Classic x11, xfce x11, kde plasma wayland, kde plasma x11 - all on LinuxMint 22 and cudatext works just fine. Fonts are bit bad for qt6 version, but that should be fixed in current trunk. Now I'll install qt5 version and make quick test.

zeljan1 avatar Jan 02 '25 19:01 zeljan1

CudaText Qt5 also works ok, spotted that I can type only in user setting, user-default settings cannot be changed if it's relevant. Down in status bar is RO when file is read-only so it's clear.

zeljan1 avatar Jan 02 '25 19:01 zeljan1

So on the same OS (Linux Mint 22 Cinnamon, X11) we have users

  • with working keyboard input
  • with non-working input.

and this is for both Flatpak and regular versions. strange.

Alexey-T avatar Jan 02 '25 20:01 Alexey-T

So on the same OS (Linux Mint 22 Cinnamon, X11) we have users

  • with working keyboard input
  • with non-working input.

and this is for both Flatpak and regular versions. strange.

Maybe a few differences:

  • I don't believe we know whether @atarax42 encountered issue on LM Cinnamon 22 X11 or Wayland version, neither whether it was solved with CudaText deb for Qtx or GTk (or both).
  • As for me I encountered an issue exclusively with Qt5 and Qt6 versions on LM 21 Cinnamon X11. GTk version works well.
  • And @zeljan1 tested Qt5 and Qt6 version without issues on LM 22 Cinnamon X11 (as well as other desktop environments)

oleole39 avatar Jan 04 '25 14:01 oleole39

Can @zeljan1 test on Linux Mint 21 Cinnamon X11 (he currently has Mint 22)?

Alexey-T avatar Jan 04 '25 14:01 Alexey-T

Happy new year, everybody! Just to clarify: I installed both the deb and the flatpak releases on a desktop machine and a laptop, both with Linux Mint 22 Cinnamon running X11. I updated all installations to version 1.220.5.0. Text input works on all installations except for the flatpak release on my laptop.

Edit: The deb releases are those using Gtk2.

atarax42 avatar Jan 04 '25 16:01 atarax42

Can @zeljan1 test on Linux Mint 21 Cinnamon X11 (he currently has Mint 22)?

I've just tried to install Qt5 and Qt6 versions on a Linux Mint 21 Cinnamon (X11) Live CD and both Flatpak & deb versions are working... Looks like it is not the OS itself - maybe an OS update, a wrong setting or a conflict on my installed OS?

Latest @atarax42's testimony seems to show same results on an installed LM 22 Cinnamon X11 than for me on installed LM 21 Cinnamon X11.

@zeljan1 have you been testing on Live CD / freshly created VMs ? applying OS updates beforehand ?

oleole39 avatar Jan 04 '25 16:01 oleole39

On my laptop I just installed Linux Mint 22 Cinnamon in a VM and then the flatpak release of CudaText. There it works as expected without the issue.

atarax42 avatar Jan 04 '25 17:01 atarax42

Just noticed that the cursor for the text input is a vertical bar | on the deb installation where text input is not working, but on the flatpak installation where text input does not work, the cursor is an underscore _. Usually | indicates insertion of text and _ indicates text will be overwritten, and you can toggle this behaviour by pressing the <Insert> key. But that has no effect here. Maybe this gives a hint to the underlying problem.

atarax42 avatar Jan 06 '25 01:01 atarax42

Underscore caret means its read/only mode. Maybe try to toggle read/only mode from the command palette (F1). And type chars again.

But to find 'read only' item in cmd palette, you need typing in the cmd palette. Does it work?

Alexey-T avatar Jan 06 '25 08:01 Alexey-T

F1 has no effect. I can open the command palette in the menu: Help > Command palette... The caret in the search field is | but is not responsive. I can scroll down to "toggle read-only mode" and select that command. The caret of the editor turns to |, but still is not responsive. Restarting CudaText, still no input possible even with read-only deactivated. :-(

atarax42 avatar Jan 06 '25 10:01 atarax42

In my case cursors are the same whether in GTK (working input) or Qt (non-working input) versions - a vertical bar. However that led me to notice that:

  • if I sudo cudatext in the terminal, then input is working properly with Qt6 deb version .
  • if I sudo -i and then flatpak run io.github.cudatext.CudaText-Qt, input is working properly with Qt6 flatpak version.

Looks like a permission issue ?!

oleole39 avatar Jan 06 '25 10:01 oleole39

@oleole39 Are you installing the flatpak as a user flatpak (with argument --user), or system? If you're not sure, please type flatpak list|grep cudatext and show output here.

JordanL2 avatar Jan 06 '25 10:01 JordanL2

@JordanL2 I used flatpak install cudatext which seems to default to system install indeed, although I never considered that point. Alexey Torgashin io.github.cudatext.CudaText-Qt 1.220.0.3 stable system

Note that I have just tried to flatpak install --user oleole39 io.github.cudatext.CudaText-Qt in order to see if it was changing something, but I get No remote refs found similar to ‘oleole39’ error.

oleole39 avatar Jan 06 '25 10:01 oleole39

You need to run flatpak install --user flathub io.github.cudatext.CudaText-Qt, as your user not as root.

JordanL2 avatar Jan 06 '25 10:01 JordanL2

I can confirm that when running the flatpak installation as root text input works as expected. I used flatpak install flathub io.github.cudatext.CudaText-Qt flatpak list|grep cudatext returns: CudaText io.github.cudatext.CudaText-Qt 1.220.5.0 stable system

atarax42 avatar Jan 06 '25 10:01 atarax42

You need to run flatpak install --user flathub io.github.cudatext.CudaText-Qt, as your user not as root.

That shows error: No remote refs found similar to ‘flathub'

oleole39 avatar Jan 06 '25 11:01 oleole39

Maybe you don't have flathub configured as a user remote. Do: flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo first then retry.

JordanL2 avatar Jan 06 '25 11:01 JordanL2