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

Qt6 Flatpak version but pure version too: keyboard input doesn't work #5739

Open
atarax42 opened this issue Oct 20, 2024 · 11 comments
Open

Qt6 Flatpak version but pure version too: keyboard input doesn't work #5739

atarax42 opened this issue Oct 20, 2024 · 11 comments

Comments

@atarax42
Copy link

atarax42 commented Oct 20, 2024

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.

@Alexey-T
Copy link
Owner

Alexey-T commented Oct 20, 2024

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.

@atarax42 atarax42 changed the title Files cannot be edited Files cannot be edited (Flatpak) Oct 20, 2024
@atarax42
Copy link
Author

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

@Alexey-T Alexey-T changed the title Files cannot be edited (Flatpak) Flatpak version: keyboard input doesn't work Oct 20, 2024
@JordanL2
Copy link

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.

@oleole39
Copy link

oleole39 commented Oct 28, 2024

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.

@Alexey-T
Copy link
Owner

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.

@oleole39
Copy link

oleole39 commented Dec 16, 2024

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..

@Alexey-T Alexey-T changed the title Flatpak version: keyboard input doesn't work Qt6 Flatpak version but pure version too: keyboard input doesn't work Dec 16, 2024
@Alexey-T
Copy link
Owner

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

@bogen85
Copy link
Contributor

bogen85 commented Dec 16, 2024

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.

@oleole39
Copy link

oleole39 commented Dec 16, 2024

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?

@bogen85
Copy link
Contributor

bogen85 commented Dec 16, 2024

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.

@oleole39
Copy link

oleole39 commented Dec 16, 2024

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).

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

5 participants