Masterwork From Distant Lands
ActivePublic

Authored by dkazakov on Jul 27 2017, 3:09 PM.
diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cpp
index cc5dc86..00f8ae6 100644
--- a/libs/ui/KisMainWindow.cpp
+++ b/libs/ui/KisMainWindow.cpp
@@ -2127,6 +2127,27 @@ void KisMainWindow::configChanged()
Q_FOREACH (QMdiSubWindow *subwin, d->mdiArea->subWindowList()) {
subwin->setOption(QMdiSubWindow::RubberBandMove, cfg.readEntry<int>("mdi_rubberband", cfg.useOpenGL()));
subwin->setOption(QMdiSubWindow::RubberBandResize, cfg.readEntry<int>("mdi_rubberband", cfg.useOpenGL()));
+
+ /**
+ * Dirty workaround for a bug in Qt (checked on Qt 5.6.1):
+ *
+ * If you make a window "Show on top" and then switch to the tabbed mode
+ * the window will contiue to be painted in its initial "mid-screen"
+ * position. It will persist here until you explicitly switch to its tab.
+ */
+ if (viewMode == QMdiArea::TabbedView) {
+ Qt::WindowFlags oldFlags = subwin->windowFlags();
+ Qt::WindowFlags flags = oldFlags;
+
+ flags &= ~Qt::WindowStaysOnTopHint;
+ flags &= ~Qt::WindowStaysOnBottomHint;
+
+ if (flags != oldFlags) {
+ subwin->setWindowFlags(flags);
+ subwin->showMaximized();
+ }
+ }
+
}
KConfigGroup group( KSharedConfig::openConfig(), "theme");
dkazakov edited the content of this paste. (Show Details)Jul 27 2017, 3:09 PM
dkazakov changed the title of this paste from untitled to Masterwork From Distant Lands.
dkazakov updated the paste's language from autodetect to autodetect.