From 27776854fe9fbc7e2ddf4cfab7073e5e90568e8b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 7 Oct 2014 17:50:09 +0200 Subject: [PATCH] wait a while before setting the window type this because due to Qt xcb implementation the actual flags gets set only after a while after the window is actually visible. kwin has actually time to move the window since is not a dock yet, at the moment there is no solution besides moving it back BUG:339614 --- shell/panelconfigview.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/shell/panelconfigview.cpp b/shell/panelconfigview.cpp index 695e5221f..539d32a8e 100644 --- a/shell/panelconfigview.cpp +++ b/shell/panelconfigview.cpp @@ -60,10 +60,14 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa connect(&m_screenSyncTimer, &QTimer::timeout, [=]() { setScreen(panelView->screen()); + KWindowSystem::setType(winId(), NET::Dock); + setFlags(Qt::WindowFlags((flags() | Qt::FramelessWindowHint) & (~Qt::WindowDoesNotAcceptFocus))); + KWindowSystem::setState(winId(), NET::KeepAbove); syncGeometry(); }); KWindowSystem::setType(winId(), NET::Dock); + KWindowSystem::setState(winId(), NET::KeepAbove); setFlags(Qt::WindowFlags((flags() | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint) & (~Qt::WindowDoesNotAcceptFocus))); KWindowSystem::forceActiveWindow(winId()); @@ -121,7 +125,10 @@ void PanelConfigView::syncGeometry() } if (m_containment->formFactor() == Plasma::Types::Vertical) { - resize(rootObject()->implicitWidth(), screen()->size().height()); + QSize s(rootObject()->implicitWidth(), screen()->size().height()); + resize(s); + setMinimumSize(s); + setMaximumSize(s); if (m_containment->location() == Plasma::Types::LeftEdge) { setPosition(m_panelView->geometry().right(), screen()->geometry().top()); @@ -130,7 +137,10 @@ void PanelConfigView::syncGeometry() } } else { - resize(screen()->size().width(), rootObject()->implicitHeight()); + QSize s(screen()->size().width(), rootObject()->implicitHeight()); + resize(s); + setMinimumSize(s); + setMaximumSize(s); if (m_containment->location() == Plasma::Types::TopEdge) { setPosition(screen()->geometry().left(), m_panelView->geometry().bottom()); @@ -143,13 +153,17 @@ void PanelConfigView::syncGeometry() void PanelConfigView::showEvent(QShowEvent *ev) { QQuickWindow::showEvent(ev); - syncGeometry(); KWindowSystem::setType(winId(), NET::Dock); setFlags(Qt::WindowFlags((flags() | Qt::FramelessWindowHint) & (~Qt::WindowDoesNotAcceptFocus))); + KWindowSystem::setState(winId(), NET::KeepAbove); KWindowSystem::forceActiveWindow(winId()); KWindowEffects::enableBlurBehind(winId(), true); updateContrast(); + syncGeometry(); + + //this because due to Qt xcb implementation the actual flags gets set only after a while after the window is actually visible + m_screenSyncTimer.start(); if (m_containment) { m_containment->setUserConfiguring(true);