summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandkeyboard.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-09-15 14:52:14 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-09-15 13:31:52 +0000
commit2123e8877e59c1ab35018366bb42cc4e76ac9a25 (patch)
tree84c3f8892d5ebb94b53e3129dbbe515cccef9b18 /src/compositor/compositor_api/qwaylandkeyboard.cpp
parent0345bba55ab67249fd3cda721de12b5fa1d95c36 (diff)
Remove the keyboard grabber
Change-Id: I63e5764e3b0000cf84c326aca3c33e333f860d08 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandkeyboard.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandkeyboard.cpp40
1 files changed, 4 insertions, 36 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp
index 08fd783ab..b9377c853 100644
--- a/src/compositor/compositor_api/qwaylandkeyboard.cpp
+++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp
@@ -58,7 +58,6 @@ QT_BEGIN_NAMESPACE
QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandInputDevice *seat)
: QtWaylandServer::wl_keyboard()
, seat(seat)
- , grab(this)
, focus()
, focusResource()
, keys()
@@ -145,13 +144,6 @@ void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource)
wl_resource_destroy(resource->handle);
}
-void QWaylandKeyboardPrivate::key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
-{
- if (focusResource) {
- send_key(focusResource->handle, serial, time, key, state);
- }
-}
-
void QWaylandKeyboardPrivate::keyEvent(uint code, uint32_t state)
{
uint key = code - 8;
@@ -171,7 +163,8 @@ void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state)
uint32_t time = compositor()->currentTimeMsecs();
uint32_t serial = compositor()->nextSerial();
uint key = code - 8;
- grab->key(serial, time, key, state);
+ if (focusResource)
+ send_key(focusResource->handle, serial, time, key, state);
}
void QWaylandKeyboardPrivate::modifiers(uint32_t serial, uint32_t mods_depressed,
@@ -206,7 +199,7 @@ void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state)
this->modsLocked = modsLocked;
this->group = group;
- grab->modifiers(compositor()->nextSerial(), modsDepressed, modsLatched, modsLocked, group);
+ modifiers(compositor()->nextSerial(), modsDepressed, modsLatched, modsLocked, group);
#else
Q_UNUSED(code);
Q_UNUSED(state);
@@ -328,11 +321,6 @@ void QWaylandKeyboardPrivate::createXKBKeymap()
}
#endif
-
-QWaylandKeyboardGrabber::~QWaylandKeyboardGrabber()
-{
-}
-
QWaylandKeyboard::QWaylandKeyboard(QWaylandInputDevice *seat, QObject *parent)
: QObject(* new QWaylandKeyboardPrivate(seat), parent)
{
@@ -402,7 +390,7 @@ bool QWaylandKeyboard::setFocus(QWaylandSurface *surface)
QWaylandShellSurface *shellsurface = QWaylandShellSurface::findIn(surface);
if (shellsurface && shellsurface->focusPolicy() == QWaylandShellSurface::NoKeyboardFocus)
return false;
- d->grab->focused(surface);
+ d->focused(surface);
return true;
}
@@ -421,26 +409,6 @@ void QWaylandKeyboard::setKeymap(const QWaylandKeymap &keymap)
}
}
-void QWaylandKeyboard::startGrab(QWaylandKeyboardGrabber *grab)
-{
- Q_D(QWaylandKeyboard);
- d->grab = grab;
- d->grab->keyboard = this;
- d->grab->focused(d->focus);
-}
-
-void QWaylandKeyboard::endGrab()
-{
- Q_D(QWaylandKeyboard);
- d->grab = d;
-}
-
-QWaylandKeyboardGrabber *QWaylandKeyboard::currentGrab() const
-{
- Q_D(const QWaylandKeyboard);
- return d->grab;
-}
-
void QWaylandKeyboard::addClient(QWaylandClient *client, uint32_t id)
{
Q_D(QWaylandKeyboard);