From bcee3d1a9b836526415264477d2d7492afef1098 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 11 Jan 2017 01:04:41 +0200 Subject: [PATCH] fix #24, probably fixed --opening configuration window all the time and I havent found a case that this is not shown yet --- app/dockconfigview.cpp | 17 ++++++++++++----- app/dockview.cpp | 7 +++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/dockconfigview.cpp b/app/dockconfigview.cpp index 58b321aec..deaaee11d 100644 --- a/app/dockconfigview.cpp +++ b/app/dockconfigview.cpp @@ -53,10 +53,16 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, DockView *dockV connect(&m_screenSyncTimer, &QTimer::timeout, this, [this]() { setScreen(m_dockView->screen()); + KWindowSystem::setType(winId(), NET::Dock); setFlags(wFlags()); syncGeometry(); syncSlideEffect(); }); + + KWindowSystem::setType(winId(), NET::Dock); + KWindowSystem::setState(winId(), NET::KeepAbove); + setFlags(wFlags()); + KWindowSystem::forceActiveWindow(winId()); connect(dockView, &QQuickView::widthChanged, this, &DockConfigView::syncGeometry); connect(dockView, &QQuickView::heightChanged, this, &DockConfigView::syncGeometry); @@ -75,7 +81,7 @@ void DockConfigView::init() setColor(Qt::transparent); rootContext()->setContextProperty(QStringLiteral("dock"), m_dockView); rootContext()->setContextProperty(QStringLiteral("dockConfig"), this); - engine()->rootContext()->setContextObject(new KLocalizedContext(this)); + rootContext()->setContextObject(new KLocalizedContext(this)); auto source = QUrl::fromLocalFile(m_containment->corona()->kPackage().filePath("lattedockconfigurationui")); setSource(source); syncSlideEffect(); @@ -170,6 +176,8 @@ void DockConfigView::syncSlideEffect() void DockConfigView::showEvent(QShowEvent *ev) { + QQuickWindow::showEvent(ev); + KWindowSystem::setType(winId(), NET::Dock); setFlags(wFlags()); KWindowSystem::setState(winId(), NET::KeepAbove | NET::SkipPager | NET::SkipTaskbar); @@ -186,20 +194,19 @@ void DockConfigView::showEvent(QShowEvent *ev) m_deleterTimer.stop(); QTimer::singleShot(400, this, &DockConfigView::syncGeometry); - - ConfigView::showEvent(ev); + } void DockConfigView::hideEvent(QHideEvent *ev) { + QQuickWindow::hideEvent(ev); + m_deleterTimer.start(); if (m_containment) { m_dockView->saveConfig(); m_containment->setUserConfiguring(false); } - - ConfigView::hideEvent(ev); } void DockConfigView::focusOutEvent(QFocusEvent *ev) diff --git a/app/dockview.cpp b/app/dockview.cpp index 79f210f48..ab6937028 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -261,7 +261,7 @@ void DockView::showConfigurationInterface(Plasma::Applet *applet) m_configView->hide(); } else { m_configView->show(); - m_configView->requestActivate(); + //m_configView->requestActivate(); } return; @@ -282,9 +282,8 @@ void DockView::showConfigurationInterface(Plasma::Applet *applet) m_configView = new PlasmaQuick::ConfigView(applet); } - m_configView->init(); - m_configView->show(); - m_configView->requestActivate(); + m_configView.data()->init(); + m_configView.data()->show(); } void DockView::resizeWindow()