[wayland] Drop hack for faking input for Qt popups

This reverts 29c2ae57.
This commit is contained in:
Martin Gräßlin 2015-08-20 09:51:12 +02:00
parent 28b48e69fb
commit 8add14fe89
3 changed files with 0 additions and 40 deletions

View file

@ -206,7 +206,6 @@ void ApplicationWayland::continueStartupWithX()
Xcb::sync(); // Trigger possible errors, there's still a chance to abort
notifyKSplash();
waylandServer()->createDummyQtWindow();
}
void ApplicationWayland::createX11Connection()

View file

@ -115,10 +115,6 @@ void WaylandServer::init(const QByteArray &socketName)
}
if (surface->client() == m_internalConnection.server) {
// one of Qt's windows
if (m_dummyWindowSurface && (m_dummyWindowSurface->id() == surface->surface()->id())) {
fakeDummyQtWindowInput();
return;
}
// HACK: in order to get Qt to not block for frame rendered, we immediatelly emit the
// frameRendered once we get a new damage event.
auto s = surface->surface();
@ -310,37 +306,6 @@ void WaylandServer::removeClient(ShellClient *c)
emit shellClientRemoved(c);
}
void WaylandServer::createDummyQtWindow()
{
if (m_dummyWindow) {
return;
}
m_dummyWindow.reset(new QWindow());
m_dummyWindow->setSurfaceType(QSurface::RasterSurface);
m_dummyWindow->show();
m_dummyWindowSurface = KWayland::Client::Surface::fromWindow(m_dummyWindow.data());
}
void WaylandServer::fakeDummyQtWindowInput()
{
// we need to fake Qt into believing it has got any seat events
// this is done only when receiving either a key press or button.
// we simulate by sending a button press and release
auto surface = KWayland::Server::SurfaceInterface::get(m_dummyWindowSurface->id(), m_internalConnection.server);
if (!surface) {
return;
}
const auto oldSeatSurface = m_seat->focusedPointerSurface();
const auto oldPos = m_seat->focusedPointerSurfacePosition();
m_seat->setFocusedPointerSurface(surface, QPoint(0, 0));
m_seat->setPointerPos(QPointF(0, 0));
m_seat->pointerButtonPressed(Qt::LeftButton);
m_seat->pointerButtonReleased(Qt::LeftButton);
m_internalConnection.server->flush();
m_dummyWindow->hide();
m_seat->setFocusedPointerSurface(oldSeatSurface, oldPos);
}
void WaylandServer::dispatch()
{
if (!m_display) {

View file

@ -109,7 +109,6 @@ public:
int createInputMethodConnection();
void createInternalConnection();
void createDummyQtWindow();
void initWorkspace();
KWayland::Server::ClientConnection *xWaylandConnection() const {
@ -138,7 +137,6 @@ Q_SIGNALS:
void shellClientRemoved(ShellClient*);
private:
void fakeDummyQtWindowInput();
quint16 createClientId(KWayland::Server::ClientConnection *c);
KWayland::Server::Display *m_display = nullptr;
KWayland::Server::CompositorInterface *m_compositor = nullptr;
@ -160,8 +158,6 @@ private:
AbstractBackend *m_backend = nullptr;
QList<ShellClient*> m_clients;
QList<ShellClient*> m_internalClients;
QScopedPointer<QWindow> m_dummyWindow;
KWayland::Client::Surface *m_dummyWindowSurface = nullptr;
QHash<KWayland::Server::ClientConnection*, quint16> m_clientIds;
KWIN_SINGLETON(WaylandServer)
};