Menu

#2176 Qt terminal issue on wayland

None
closed-not-a-bug
nobody
2022-01-15
2019-05-28
Vishnu
No

I'm currently using the following version, on linux:

G N U P L O T
Version 5.2 patchlevel 6    last modified 2019-01-01 

The qt terminal does not display anything when on a wayland-based desktop. The window does not even open. Instead, I see the folloing message on the terminal:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland-egl" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

The QT_QPA_PLATFORM environment variable is currently set to "wayland-egl", because that is what other Qt-based software need it to be. Now, as the message above says, if I set it to "wayland", I still get more-or-less the same error:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Discussion

  • Vishnu

    Vishnu - 2019-05-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
     Version 5.2 patchlevel 6    last modified 2019-01-01 
     ~~~
    
    -The qt terminal does not display when on a wayland-based desktop. The message output is:
    +The qt terminal does not display anything when on a wayland-based desktop. The window does not even open. Instead, I see the folloing message on the terminal:
    
     ~~~
     Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
    
    • Group: -->
    • Priority: -->
     
  • Vishnu

    Vishnu - 2019-05-28

    Possibly related:
    https://bugzilla.redhat.com/show_bug.cgi?id=1641849
    But nothing like what's been described there happens to me. it does not crash the desktop. Also, I have no issues with Python's matplotlib. It displays fine.

     
  • Ethan Merritt

    Ethan Merritt - 2019-05-28

    I think there is a good chance that this does not have anything to do with gnuplot per se except insofar as gnuplot's qt terminal is a Qt application. Probably you will need to sort this out for all Qt applications.

    Does your system have the Qt wayland support plugins installed? They are probably in a separate package. On my machine this seems to be

    Name : qtwayland5
    Version : 5.12.2
    Release : 2.mga7
    Group : Development/KDE and Qt
    Size : 1562012 Architecture: x86_64
    Source RPM : qtwayland5-5.12.2-2.mga7.src.rpm
    URL : https://www.qt.io
    Summary : Qt5 Wayland platform support and QtCompositor module

    But I am not actually using a Wayland desktop, so I can't say whether this helps with your problem or not. The mention of "wayland-egl" in your error message is a further worry. I gather from a quick web search that this is an extra library/layer for NVIDIA graphics cards. I know nothing else about it.

    If you get it working, please report what you did so we can include the information in README, FAQ, etc.

     
  • Ethan Merritt

    Ethan Merritt - 2019-05-29

    Update: I have now tried out gnuplot + qt on a Wayland desktop. It seems to work fine, although it does emit the following warning on startup:

     QSocketNotifier: Can only be used with threads started with QThread
     Using Wayland-EGL
     Using the 'xdg-shell' shell integration
    

    Setting QT_QPA_PLATFORM was not necessary (and had no obvious effect).
    Hope that helps.

     
  • Vishnu

    Vishnu - 2019-05-29

    Ah! That was the issue. I had to install the qt5-wayland package (Archlinux).

    It is a bit uglier than the x11 term, or the qt term on an X11 desktop, in that it does not take the theme of the rest of the desktop, but that is a minor issue. At-least it works for me now.

    I get similar errors too:

    Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
    Using Wayland-EGL
    xkbcommon: ERROR: Couldn't read Compose file /usr/share/X11/locale/: No such device
    Using the 'xdg-shell' shell integration
    

    Also, when I click a button that produces another window, like say the save dialog, I get the following message:

    qt.qpa.wayland: Non-toplevel surfaces can't request window states
    
     
  • Ethan Merritt

    Ethan Merritt - 2019-05-29
    • status: open --> open-works-for-me
     
  • Ethan Merritt

    Ethan Merritt - 2019-05-29

    I also see ugly window decorations and those alarming warning messages. I conclude that the Wayland desktop is not quite ready for prime time, but it does basically work for running gnuplot.

    You got one actual error (from xkbcommon) that I didn't. I think for Wayland you need to switch from xkb to input methods based on ibus. Again this has nothing to do with gnuplot per se.

     
  • Ethan Merritt

    Ethan Merritt - 2019-12-03
    • Status: open-works-for-me --> closed-not-a-bug
     
  • Fabio

    Fabio - 2022-01-15

    Since this seems to be a common issue, I just want to suggest a tip in case you want to make a plot running a script (for instance plot.plt or plot.cmd or plot.bh) from command line as follows:

    gnuplot -c plot.plt
    

    In this way, the plot window survives ONLY for an instant before closing and the following warning message shows up:

    Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
    

    In order to deceive this issue in the easiest way, there is a proper option available in gnuplot, which is the --persistent or simply -p option. Directly from the manual it "let the plot windows survive after main gnuplot program exits."

    gnuplot -pc plot.plt
    

    In this way the plot doesn't immediately close right after have been generated. This is NOT a solution for this issue, but de facto it's only a suggest to partially avoid the problem. Since this helped me a lot, I thought this could be helpful for someone else, maybe.

     

Log in to post a comment.

MongoDB Logo MongoDB