Commit fc5a4540 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Fix krunner's alt+f2 on wayland

Summary:
Don't go through the workaround introduced for X11 that makes it go mental.

BUG: 385693

Test Plan: Have been a happy krunner user since

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: ngraham, davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10197
parent aee0a5cf
......@@ -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 @@ View::~View()
{
}
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()));
......@@ -227,38 +200,6 @@ bool View::event(QEvent *event)
if (setState) {
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
}
if (m_plasmaShell && event->type() == QEvent::Expose) {
using namespace KWayland::Client;
auto ee = static_cast<QExposeEvent*>(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<QMoveEvent *>(event);
m_plasmaShellSurface->setPosition(me->pos());
}
return retval;
}
......
......@@ -91,16 +91,12 @@ protected Q_SLOTS:
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 <KWayland::Client::PlasmaShellSurface> m_plasmaShellSurface;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment