SUMMARY When openning some images (seems to mainly affect JPG) if the thumbnail bar is set to be enabled by default, it'll pop up as a new window instead of embedded in the main one. Closing it and reopenning it cause the issue to go away. I believe this is a new issue and wasn't there a few months ago. Testing a commit from Jan 2020 still shows the issue so I think it's likely to be caused by upgrading to qt 5.15. It's quite hard for me to downgrade qt for testing though I may try to compile a debug version... STEPS TO REPRODUCE 1. Open a jpg image OBSERVED RESULT Thumbnail view bar pops up as new window. EXPECTED RESULT It shouldn't be SOFTWARE/OS VERSIONS Linux/KDE Plasma: ArchLinux x86_64 KDE Plasma Version: 5.19.5 KDE Frameworks Version: 5.74.0 Qt Version: 5.15.1 ADDITIONAL INFORMATION
I'm still not sure what's changed but the issue seems to be caused by showing a widget before a parent is set. In `app/viewmainpage.cpp`, `mThumbnailBar` was created without a parent and may be set to visible immediately after creation before it is added to `mThumbnailSplitter`. This caused a toplevel `QXcbWindow` to be created for it. The following patch fixes/works around the issue. ``` diff --git a/app/viewmainpage.cpp b/app/viewmainpage.cpp index 35c5ce59..d1faa431 100644 --- a/app/viewmainpage.cpp +++ b/app/viewmainpage.cpp @@ -148,7 +148,6 @@ struct ViewMainPagePrivate mThumbnailBar = new ThumbnailBarView; ThumbnailBarItemDelegate* delegate = new ThumbnailBarItemDelegate(mThumbnailBar); mThumbnailBar->setItemDelegate(delegate); - mThumbnailBar->setVisible(GwenviewConfig::thumbnailBarIsVisible()); mThumbnailBar->setSelectionMode(QAbstractItemView::ExtendedSelection); } @@ -330,6 +329,7 @@ struct ViewMainPagePrivate mThumbnailSplitter->addWidget(mAdapterContainer); mThumbnailSplitter->addWidget(mThumbnailBar); mThumbnailSplitter->setSizes(GwenviewConfig::thumbnailSplitterSizes()); + mThumbnailBar->setVisible(GwenviewConfig::thumbnailBarIsVisible()); QVBoxLayout* layout = new QVBoxLayout(q); layout->setContentsMargins(0, 0, 0, 0); ``` This seems to be fairly harmless. I'm not sure though if this is supposed to be working.
Ref https://bugreports.qt.io/browse/QTBUG-87345
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/17
I've reduced the test case in the Qt bug report so I'm fairly sure it's a Qt bug now. https://bugreports.qt.io/browse/QTBUG-87345?focusedCommentId=530782&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-530782 Also submitted https://invent.kde.org/graphics/gwenview/-/merge_requests/17 as a workaround as well as general improvement...
*** Bug 421005 has been marked as a duplicate of this bug. ***
*** Bug 418612 has been marked as a duplicate of this bug. ***
Git commit e737554c9faff3be27083497c26675155bcf8122 by Yichao Yu. Committed on 13/10/2020 at 00:19. Pushed by ngraham into branch 'release/20.08'. Set visibility after setting parent This avoids recreating native window, which should be generally good, and works around QTBUG-87345. M +3 -1 app/viewmainpage.cpp https://invent.kde.org/graphics/gwenview/commit/e737554c9faff3be27083497c26675155bcf8122