| Summary: | Thumbnail view pops out as new window on Qt 5.15 | ||
|---|---|---|---|
| Product: | [Applications] gwenview | Reporter: | Yichao Yu <yyc1992> |
| Component: | general | Assignee: | Gwenview Bugs <gwenview-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | drokergeek, nate, postix |
| Priority: | NOR | ||
| Version First Reported In: | 20.08.2 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/gwenview/commit/e737554c9faff3be27083497c26675155bcf8122 | Version Fixed/Implemented In: | 20.08.3 |
| Sentry Crash Report: | |||
|
Description
Yichao Yu
2020-10-12 05:28:10 UTC
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.
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 |