qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.63k stars 3.01k forks source link

Warnings when starting QGIS (on linux) #46031

Open rduivenvoorde opened 3 years ago

rduivenvoorde commented 3 years ago

What is the bug or the crash?

When starting (self compiled) QGIS master OR 3.22 I get the following warning in my terminal:

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

From https://forum.qt.io/topic/126731/what-is-this-warning I concluded that I had to change my start script and added:

export QT_QPA_PLATFORM=wayland
export XDG_SESSION_TYPE=

Which 'solved' it. I'm not sure if this is some relict of my (older) desktop setup or if others also encounter this (apparently safe) warning.

Another warning I only have with master, NOT with 3.22 is:

Warning: QSocketNotifier: Can only be used with threads started with QThread
Stacktrace (piped through c++filt):
/home/richard/bin/qgis_/master/debug/bin/qgis(+0xe24c)[0x55f7ac69e24c]

Googling brought me: https://forum.qt.io/topic/29587/solved-qsocketnotifier-can-only-be-used-with-threads-started-with-qthread which tells me it has something todo with QFileSystemWatcher and with not using 'start' on a Thread...

Not sure if this is only me, or if this is a potential issue?

Steps to reproduce the issue

Start QGIS from command line, setting some environment vars in bash like below:

#!/usr/bin/env bash

export QT_QPA_PLATFORM=wayland
export XDG_SESSION_TYPE=
export QGIS_PREFIX_PATH=/home/richard/bin/qgis_/master/debug
# see https://qtibia.com/how-to-setup-pycharm-for-qgis-development-under-linux-and-windows/
export PYTHONPATH=$QGIS_PREFIX_PATH/share/qgis/python/plugins:$QGIS_PREFIX_PATH/share/qgis/python:/home/richard/bin/pycharm_/debug-eggs/pydevd-pycharm.egg

export LD_LIBRARY_PATH=$QGIS_PREFIX_PATH/lib:/usr/lib:/usr/lib/grass78/lib
# with Oracle
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/instantclient_19_9/

# from https://www.qtcentre.org/threads/70250-QMYSQL-Driver-not-Loaded-there-are-no-driver-Available-on-the-QSqlDatabase
# show debug for qt plugins
QT_DEBUG_PLUGINS=0

export QGIS_DEBUG=0
# passing ALL parameters to qgis bin
# eg to be able to call a certain translation
# qgis --lang nl
#gdb /home/richard/bin/qgis_/master/debug/bin/qgis "$@"
/home/richard/bin/qgis_/master/debug/bin/qgis "$@"

Versions

QGIS version 3.23.0-Master QGIS code revision 637e5ca748d
Qt version 5.15.2
Python version 3.9.8
GDAL/OGR version 3.3.3
PROJ version 8.2.0
EPSG Registry database version v10.038 (2021-10-21)
GEOS version 3.10.1-CAPI-1.16.0
SQLite version 3.36.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Debian GNU/Linux bookworm/sid

and

QGIS version 3.22.0-Białowieża QGIS code revision 95f7829346
Qt version 5.15.2
Python version 3.9.7
Compiled against GDAL/OGR 3.3.2 Running against GDAL/OGR 3.3.3
Compiled against PROJ 8.1.1.%3.%4 Running against PROJ 8.2.0
EPSG Registry database version v10.038 (2021-10-21)
Compiled against GEOS 3.10.0-CAPI-1.16.0 Running against GEOS 3.10.1-CAPI-1.16.0
SQLite version 3.36.0
PostgreSQL client version 14.0 (Debian 14.0-1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Debian GNU/Linux bookworm/sid
       

This copy of QGIS writes debugging output.   |   |   |  

Supported QGIS version

New profile

Additional context

No response

nyalldawson commented 3 years ago

I wouldn't recommend running qgis under a Wayland session at all. Qt 5 doesn't have great support for Wayland sessions.

rduivenvoorde commented 3 years ago

Are you sure? https://doc.qt.io/qt-5/wayland-and-qt.html does not mention that we should not, and in most Distro's I think Wayland/Gnome is more or less mainstream?

$ apt search wayland | grep qt

fcitx5-frontend-qt5/testing,testing,now 5.0.7-2 amd64 [installed,automatic]
gambas3-gb-qt5-wayland/testing,testing 3.16.3-2 amd64
layer-shell-qt/testing,testing 5.23.2-1 amd64
libfcitx5-qt-data/testing,testing,now 5.0.7-2 all [installed,automatic]
libfcitx5-qt-dev/testing,testing 5.0.7-2 amd64
libfcitx5-qt1/testing,testing,now 5.0.7-2 amd64 [installed,automatic]
liblayershellqtinterface-dev/testing,testing 5.23.2-1 amd64
liblayershellqtinterface5/testing,testing 5.23.2-1 amd64
libqt5waylandclient5/testing,testing,now 5.15.2-4 amd64 [installed,automatic]
libqt5waylandclient5-dev/testing,testing 5.15.2-4 amd64
libqt5waylandcompositor5/testing,testing,now 5.15.2-4 amd64 [installed,automatic]
libqt5waylandcompositor5-dev/testing,testing 5.15.2-4 amd64
qml-module-qtwayland-client-texturesharing/testing,testing 5.15.2-4 amd64
qml-module-qtwayland-compositor/testing,testing 5.15.2-4 amd64
qtwayland5/testing,testing,now 5.15.2-4 amd64 [installed,automatic]
qtwayland5-dev-tools/testing,testing 5.15.2-4 amd64
qtwayland5-doc/testing,testing,now 5.15.2-4 all [installed,automatic]
qtwayland5-doc-html/testing,testing 5.15.2-4 all
qtwayland5-examples/testing,testing 5.15.2-4 amd64
qtwayland5-private-dev/testing,testing 5.15.2-4 amd64
nyalldawson commented 3 years ago

Yep -- there's a lot of unsolved issues, even on current Qt versions. Just scroll through https://pointieststick.com/category/this-week-in-kde/ and you'll see that KDE is STILL working to a usable version under Wayland, and a lot of the issues they work on are upstream.

Paltis96 commented 1 year ago

Looks like Xorg is going to be removed from the codebase in some distributions. Red hut is going to remove it in the 40 Fedora release...

secretmango commented 1 year ago

I wouldn't recommend running qgis under a Wayland session at all. Qt 5 doesn't have great support for Wayland sessions.

I use Fedora KDE with Wayland only since a year or so. Qt perfectly works in Wayland.

Yes @Paltis96 this is important. To be fair, Xwayland will still be there, which is what QGis currently runs in (on Fedora it does not, but displays a warning about incomplete features).

Is there some documentation about what is actually missing? As a beginner I would have no idea, forcing XWayland currently to avoid any issues though.

nyalldawson commented 1 year ago

Qt perfectly works in Wayland.

As an example: try dragging a panel or a toolbar -- you'll end up with a broken application state that can't be fixed on Wayland.

This particular one is fixed in qt6/KDE plasma 6 Wayland sessions, but not qt5 or qt6/gnome yet.

agiudiceandrea commented 1 year ago

See also https://github.com/qgis/QGIS-Website/pull/1196/files#diff-b1cadc89d24da7a18e53486f114d4097fdf7ef22f9ae7d045b2c24f2d6bc9f02R122-R128

michaelaye commented 2 weeks ago

Qt perfectly works in Wayland.

As an example: try dragging a panel or a toolbar -- you'll end up with a broken application state that can't be fixed on Wayland.

This particular one is fixed in qt6/KDE plasma 6 Wayland sessions, but not qt5 or qt6/gnome yet.

This is a particularly helpful factoid. Does that mean that QGIS should discover if it's running on a Plasma 6 Wayland and remove the warning in this case? Or are there other things that even on Plasma6-Wayland don't work well still?

nyalldawson commented 2 weeks ago

@michaelaye

Does that mean that QGIS should discover if it's running on a Plasma 6 Wayland and remove the warning in this case? Or are there other things that even on Plasma6-Wayland don't work well still?

Well, I just test using a bleeding-edge Qt 6.8 build in Plasma 6.2, and there's STILL issues with wayland :angry: Eg:

Then there's also shortcomings on the QGIS side which we need to fix (when there's motivation...), eg the color picker option to sample colors from the screen is broken in wayland environments.

Sad to say, in November 2024 wayland is still a buggy place for users. Hopefully all the wayland upstream policy changes will have a positive result and get this mess fixed for good...

In the meantime, I think we should leave the warning in place.