[wayland] Drop methods on Toplevel to send input events

No longer needed as InputRedirection sends input events directly
through the SeatInterface. In addition this drops the dependency on
xtest.
This commit is contained in:
Martin Gräßlin 2015-02-26 16:23:25 +01:00
parent 7bb107ba6d
commit 9ca992a329
8 changed files with 0 additions and 121 deletions

View file

@ -170,7 +170,6 @@ find_package(XCB
KEYSYMS KEYSYMS
IMAGE IMAGE
SHM SHM
XTEST
GLX GLX
OPTIONAL_COMPONENTS OPTIONAL_COMPONENTS
ICCCM ICCCM
@ -494,14 +493,12 @@ set(kwin_XCB_LIBS
XCB::RANDR XCB::RANDR
XCB::KEYSYMS XCB::KEYSYMS
XCB::SHM XCB::SHM
XCB::XTEST
XCB::GLX XCB::GLX
) )
set(kwin_WAYLAND_LIBS set(kwin_WAYLAND_LIBS
Wayland::Client Wayland::Client
Wayland::Cursor Wayland::Cursor
XCB::XTEST
XKB::XKB XKB::XKB
KF5::WaylandClient KF5::WaylandClient
KF5::WaylandServer KF5::WaylandServer

View file

@ -59,7 +59,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// XLib // XLib
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <fixx11h.h> #include <fixx11h.h>
#include <xcb/xtest.h>
// system // system
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
@ -2399,40 +2398,6 @@ void Client::showOnScreenEdge()
xcb_delete_property(connection(), window(), atoms->kde_screen_edge_show); xcb_delete_property(connection(), window(), atoms->kde_screen_edge_show);
} }
void Client::sendPointerButtonEvent(uint32_t button, InputRedirection::PointerButtonState state)
{
// TODO: don't use xtest
uint8_t type = XCB_BUTTON_PRESS;
if (state == KWin::InputRedirection::PointerButtonReleased) {
type = XCB_BUTTON_RELEASE;
}
xcb_test_fake_input(connection(), type, InputRedirection::toXPointerButton(button), XCB_TIME_CURRENT_TIME, frameId(), 0, 0, 0);
}
void Client::sendPointerAxisEvent(InputRedirection::PointerAxis axis, qreal delta)
{
// TODO: don't use xtest
const int val = qRound(delta);
if (val == 0) {
return;
}
const uint8_t button = InputRedirection::toXPointerButton(axis, delta);
for (int i = 0; i < qAbs(val); ++i) {
xcb_test_fake_input(connection(), XCB_BUTTON_PRESS, button, XCB_TIME_CURRENT_TIME, frameId(), 0, 0, 0);
xcb_test_fake_input(connection(), XCB_BUTTON_RELEASE, button, XCB_TIME_CURRENT_TIME, frameId(), 0, 0, 0);
}
}
void Client::sendKeybordKeyEvent(uint32_t key, InputRedirection::KeyboardKeyState state)
{
// TODO: don't use xtest
uint8_t type = XCB_KEY_PRESS;
if (state == InputRedirection::KeyboardKeyReleased) {
type = XCB_KEY_RELEASE;
}
xcb_test_fake_input(connection(), type, key + 8, XCB_TIME_CURRENT_TIME, frameId(), 0, 0, 0);
}
#define BORDER(which) \ #define BORDER(which) \
int Client::border##which() const \ int Client::border##which() const \
{ \ { \

View file

@ -694,10 +694,6 @@ public:
**/ **/
void showOnScreenEdge(); void showOnScreenEdge();
void sendPointerButtonEvent(uint32_t button, InputRedirection::PointerButtonState state) override;
void sendPointerAxisEvent(InputRedirection::PointerAxis axis, qreal delta) override;
void sendKeybordKeyEvent(uint32_t key, InputRedirection::KeyboardKeyState state) override;
public Q_SLOTS: public Q_SLOTS:
void closeWindow(); void closeWindow();
void updateCaption(); void updateCaption();

View file

@ -445,39 +445,6 @@ void Toplevel::setSkipCloseAnimation(bool set)
emit skipCloseAnimationChanged(); emit skipCloseAnimationChanged();
} }
void Toplevel::sendPointerEnterEvent(const QPointF &globalPos)
{
Q_UNUSED(globalPos)
}
void Toplevel::sendPointerLeaveEvent(const QPointF &globalPos)
{
Q_UNUSED(globalPos)
}
void Toplevel::sendPointerMoveEvent(const QPointF &globalPos)
{
Q_UNUSED(globalPos)
}
void Toplevel::sendPointerButtonEvent(uint32_t button, InputRedirection::PointerButtonState state)
{
Q_UNUSED(button)
Q_UNUSED(state)
}
void Toplevel::sendPointerAxisEvent(InputRedirection::PointerAxis axis, qreal delta)
{
Q_UNUSED(axis)
Q_UNUSED(delta)
}
void Toplevel::sendKeybordKeyEvent(uint32_t key, InputRedirection::KeyboardKeyState state)
{
Q_UNUSED(key)
Q_UNUSED(state)
}
#if HAVE_WAYLAND #if HAVE_WAYLAND
void Toplevel::setSurface(KWayland::Server::SurfaceInterface *surface) void Toplevel::setSurface(KWayland::Server::SurfaceInterface *surface)
{ {

View file

@ -359,13 +359,6 @@ public:
void setSurface(KWayland::Server::SurfaceInterface *surface); void setSurface(KWayland::Server::SurfaceInterface *surface);
#endif #endif
virtual void sendPointerMoveEvent(const QPointF &globalPos);
virtual void sendPointerEnterEvent(const QPointF &globalPos);
virtual void sendPointerLeaveEvent(const QPointF &globalPos);
virtual void sendPointerButtonEvent(uint32_t button, InputRedirection::PointerButtonState state);
virtual void sendPointerAxisEvent(InputRedirection::PointerAxis axis, qreal delta);
virtual void sendKeybordKeyEvent(uint32_t key, InputRedirection::KeyboardKeyState state);
/** /**
* @brief Finds the Toplevel matching the condition expressed in @p func in @p list. * @brief Finds the Toplevel matching the condition expressed in @p func in @p list.
* *

View file

@ -30,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDebug> #include <QDebug>
#include <xcb/shape.h> #include <xcb/shape.h>
#include <xcb/xtest.h>
namespace KWin namespace KWin
{ {
@ -155,40 +154,6 @@ NET::WindowType Unmanaged::windowType(bool direct, int supportedTypes) const
return info->windowType(NET::WindowTypes(supportedTypes)); return info->windowType(NET::WindowTypes(supportedTypes));
} }
void Unmanaged::sendPointerButtonEvent(uint32_t button, InputRedirection::PointerButtonState state)
{
// TODO: don't use xtest
uint8_t type = XCB_BUTTON_PRESS;
if (state == KWin::InputRedirection::PointerButtonReleased) {
type = XCB_BUTTON_RELEASE;
}
xcb_test_fake_input(connection(), type, InputRedirection::toXPointerButton(button), XCB_TIME_CURRENT_TIME, window(), 0, 0, 0);
}
void Unmanaged::sendPointerAxisEvent(InputRedirection::PointerAxis axis, qreal delta)
{
// TODO: don't use xtest
const int val = qRound(delta);
if (val == 0) {
return;
}
const uint8_t button = InputRedirection::toXPointerButton(axis, delta);
for (int i = 0; i < qAbs(val); ++i) {
xcb_test_fake_input(connection(), XCB_BUTTON_PRESS, button, XCB_TIME_CURRENT_TIME, window(), 0, 0, 0);
xcb_test_fake_input(connection(), XCB_BUTTON_RELEASE, button, XCB_TIME_CURRENT_TIME, window(), 0, 0, 0);
}
}
void Unmanaged::sendKeybordKeyEvent(uint32_t key, InputRedirection::KeyboardKeyState state)
{
// TODO: don't use xtest
uint8_t type = XCB_KEY_PRESS;
if (state == InputRedirection::KeyboardKeyReleased) {
type = XCB_KEY_RELEASE;
}
xcb_test_fake_input(connection(), type, key + 8, XCB_TIME_CURRENT_TIME, window(), 0, 0, 0);
}
} // namespace } // namespace
#include "unmanaged.moc" #include "unmanaged.moc"

View file

@ -47,9 +47,6 @@ public:
} }
NET::WindowType windowType(bool direct = false, int supported_types = 0) const; NET::WindowType windowType(bool direct = false, int supported_types = 0) const;
void sendPointerButtonEvent(uint32_t button, InputRedirection::PointerButtonState state) override;
void sendPointerAxisEvent(InputRedirection::PointerAxis axis, qreal delta) override;
void sendKeybordKeyEvent(uint32_t key, InputRedirection::KeyboardKeyState state) override;
public Q_SLOTS: public Q_SLOTS:
void release(ReleaseReason releaseReason = ReleaseReason::Release); void release(ReleaseReason releaseReason = ReleaseReason::Release);
protected: protected:

View file

@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMetaMethod> #include <QMetaMethod>
#include <QThread> #include <QThread>
// xcb // xcb
#include <xcb/xtest.h>
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
// Wayland // Wayland
#include <wayland-client-protocol.h> #include <wayland-client-protocol.h>