Closed wamserma closed 2 years ago
Thank you very much for reporting!
I'll investigate the part related to pcmanfm-qt
soon.
Based on the dump, the problem would probably be comparing null here -> https://github.com/lxqt/libfm-qt/blob/master/src/core/folder.cpp#L535
EDIT: As the URI scheme can be null -> https://libsoup.org/gio/GFile.html#g-file-get-uri-scheme
@tsujan Shouldn't we rather use there the hasUriScheme
:
diff --git a/src/core/folder.cpp b/src/core/folder.cpp
index 5bb4013..710a913 100644
--- a/src/core/folder.cpp
+++ b/src/core/folder.cpp
@@ -532,7 +532,7 @@ void Folder::onDirListFinished() {
const auto& infos = job->files();
// with "search://", there is no update for infos and all of them should be added
- if(strcmp(dirPath_.uriScheme().get(), "search") == 0) {
+ if(dirPath_.hasUriScheme("search")) {
files_to_add = infos;
for(auto& file: files_to_add) {
files_[file->path().baseName().get()] = file;
Yes, either Fm::FilePath::hasUriScheme()
or g_strcmp0()
needs to be used there. That should be fixed. Thanks!
But, IMO, we should also prevent an empty string for desktop.
But, IMO, we should also prevent an empty string for desktop.
+1
https://github.com/lxqt/libfm-qt/pull/808 will fix the crash and close this report after it's merged. It's the same as @palinek's fix above.
For users' convenience, I'll make another PR for preventing an empty Desktop path in pcmanfm-qt
.
As for lxqt-session
, another report could be made for it if it really needs a change in this regard. Since the crash will be fixed by the above-mentioned PR, I don't think more change is needed.
I can confirm the crash is fixed by https://github.com/lxqt/libfm-qt/pull/808.
Preventing an empty desktop path is still a good idea.
Regarding lxqt-session
: I was torn whether I should open the issue here or in libfm-qt
. I simply chose this repo, because it manifested upon login. No further changes needed for lxqt-session
.
@wamserma Thanks for testing!
Preventing an empty desktop path is still a good idea.
I'll make a pcmanfm-qt PR for that soon.
This is the PR for pcmanfm-qt: https://github.com/lxqt/pcmanfm-qt/pull/1601.
An empty desktop path will be accepted only if it's set explicitly in ~/.config/user-dirs.dirs
, like XDG_DESKTOP_DIR=""
; otherwise — if the file doesn't exist or doesn't contain a desktop path — $HOME/Desktop
will be used.
If
~/.config/user-dirs.dirs
is not empty but missing an entry forXDG_DESKTOP_DIR
, a crash is reported upon logging in to a fresh LXQt session.This was encountered while updating from NixOS 21.11 to 22.05 (LXQt 0.17 to 1.1.0). Leaving
~/.config/user-dirs.dirs
empty, removing it or adding the entry with a text editor solved the issue. Only having e.g. an entry forXDG_PICTURES_DIR
triggered the crash.This was confirmed on Ubuntu 22.04 (yes LTS, but very fresh) with LXQt on Mutter. Simply commenting out the line with
XDG_DESKTOP_DIR
triggered the crash at next login (crash was reported for mutter).Expected Behavior
LXQt should fall back to
XDG_DESKTOP_DIR=$HOME/Desktop
Current Behavior
See description above.
Possible Solution
See above.
Steps to Reproduce (for bugs)
~/.config/user-dirs.dirs
is not empty, but has no entry forXDG_DESKTOP_DIR
Context
This might not be in lxqt-session (though https://github.com/lxqt/lxqt-session/blob/9d63aba3cdb88dafb837fe3e94ada3047de7ec0c/startlxqt.in#L39 looks suspicious, but also this https://github.com/lxqt/pcmanfm-qt/blob/4659da4f7428abb43326b794a9983006dbead3a3/pcmanfm/xdgdir.cpp#L35)
System Information
The core dump I got on NixOS: