helloSystem / Filer

A file manager that can also render the desktop
GNU General Public License v2.0
31 stars 9 forks source link

desktopwindow: fix crash on stylesheet loading #76

Closed ghost closed 3 years ago

ghost commented 3 years ago

This caused the eventFilter() function to be called as part of the application of the stylesheet, and listView_ was a NULL pointer, hence the segfault. Fixed by checking the pointer before dereferencing.

Signed-off-by: Chris Moore chris@mooreonline.org

https://github.com/helloSystem/QtPlugin/issues/2

@probonopd please review

probonopd commented 3 years ago

Interesting. I was led to believe that the issue was not with Filer but with QtPlugin, especially since https://github.com/mildred/qfm also crashes when used with it and when loading a stylesheet. https://github.com/helloSystem/QtPlugin/issues/2#issuecomment-816825930

But in any case, with this patch the crash no longer happens.

Thank you very much! (I really would like to learn the magic to debug things like this. Maybe you can teach me how to do it at some time.)

ghost commented 3 years ago

Yeah I think possibly a coincidence that qfm crashes too, as this was certainly the cause in Filer.

Qt Creator works very well with gdb once you set it all up (would be nice to get LLDB working instead, but there seem to be issues with that)

probonopd commented 3 years ago

Strangely I always get a white desktop wallpaper as soon as I try to load in a qss stylesheet that is not blank - can you reproduce this?

ghost commented 3 years ago

Strangely I always get a white desktop wallpaper as soon as I try to load in a qss stylesheet that is not blank - can you reproduce this?

Yes, I see that as well. Perhaps the stylesheet is applied after the background is set and the style sets the background colour?

probonopd commented 3 years ago

Indeed, this would be an explanation. Which would mean that we'd probably have to change our QtPlugin so that it only hints at, but does not override, styles. (Hopefully I can find out how.)