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.
Diff:
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.
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.
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:
Setting QT_QPA_PLATFORM was not necessary (and had no obvious effect).
Hope that helps.
Ah! That was the issue. I had to install the
qt5-waylandpackage (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:
Also, when I click a button that produces another window, like say the save dialog, I get the following message:
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.
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:
In this way, the plot window survives ONLY for an instant before closing and the following warning message shows up:
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."
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.