diff --git a/krunner/view.h b/krunner/view.h --- a/krunner/view.h +++ b/krunner/view.h @@ -91,16 +91,12 @@ private: void writeHistory(); - void initWayland(); - QPoint m_customPos; KDeclarative::QmlObject *m_qmlObj; KConfigGroup m_config; qreal m_offset; bool m_floating : 1; QStringList m_history; - KWayland::Client::PlasmaShell *m_plasmaShell; - QPointer m_plasmaShellSurface; }; diff --git a/krunner/view.cpp b/krunner/view.cpp --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -52,10 +52,8 @@ View::View(QWindow *) : PlasmaQuick::Dialog(), m_offset(.5), - m_floating(false), - m_plasmaShell(nullptr) + m_floating(false) { - initWayland(); setClearBeforeRendering(true); setColor(QColor(Qt::transparent)); setFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); @@ -143,31 +141,6 @@ { } -void View::initWayland() -{ - if (!KWindowSystem::isPlatformWayland()) { - return; - } - using namespace KWayland::Client; - auto connection = ConnectionThread::fromApplication(this); - if (!connection) { - return; - } - Registry *registry = new Registry(this); - registry->create(connection); - QObject::connect(registry, &Registry::interfacesAnnounced, this, - [registry, this] { - const auto interface = registry->interface(Registry::Interface::PlasmaShell); - if (interface.name != 0) { - m_plasmaShell = registry->createPlasmaShell(interface.name, interface.version, this); - } - } - ); - - registry->setup(); - connection->roundtrip(); -} - void View::objectIncubated() { connect(m_qmlObj->rootObject(), SIGNAL(widthChanged()), this, SLOT(resetScreenPos())); @@ -216,49 +189,15 @@ bool View::event(QEvent *event) { - // QXcbWindow overwrites the state in its show event. There are plans - // to fix this in 5.4, but till then we must explicitly overwrite it - // each time. const bool retval = Dialog::event(event); + bool setState = event->type() == QEvent::Show; if (event->type() == QEvent::PlatformSurface) { setState = (static_cast(event)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated); } if (setState) { KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); } - - if (m_plasmaShell && event->type() == QEvent::Expose) { - using namespace KWayland::Client; - auto ee = static_cast(event); - - if (ee->region().isNull()) { - return retval; - } - - if (!m_plasmaShellSurface && isVisible()) { - Surface *s = Surface::fromWindow(this); - if (!s) { - return retval; - } - m_plasmaShellSurface = m_plasmaShell->createSurface(s, this); - m_plasmaShellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::WindowsGoBelow); - m_plasmaShellSurface->setPanelTakesFocus(true); - m_plasmaShellSurface->setRole(PlasmaShellSurface::Role::Panel); - //this should be on showEvent, but it was too soon so none of those had any effect - KWindowSystem::setOnAllDesktops(winId(), true); - positionOnScreen(); - requestActivate(); - //positionOnScreen tried to position it in the position it already had, so no moveevent happens and we need to manually posiyion the surface - m_plasmaShellSurface->setPosition(position()); - } - } else if (event->type() == QEvent::Hide) { - delete m_plasmaShellSurface; - } else if (m_plasmaShellSurface && event->type() == QEvent::Move) { - QMoveEvent *me = static_cast(event); - m_plasmaShellSurface->setPosition(me->pos()); - } - return retval; }