diff options
Diffstat (limited to 'src/client/qwaylandinputdevice.cpp')
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 90e138a3d..2dff4b6c3 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -238,7 +238,6 @@ void QWaylandInputDevice::seat_capabilities(uint32_t caps) if (caps & WL_SEAT_CAPABILITY_POINTER && !mPointer) { mPointer = createPointer(this); mPointer->init(get_pointer()); - pointerSurface = mQDisplay->createSurface(this); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && mPointer) { delete mPointer; mPointer = nullptr; @@ -419,6 +418,9 @@ void QWaylandInputDevice::setCursor(struct wl_buffer *buffer, const QPoint &hotS return; } + if (!pointerSurface) + pointerSurface = mQDisplay->createSurface(this); + mPointer->set_cursor(mPointer->mEnterSerial, pointerSurface, hotSpot.x(), hotSpot.y()); wl_surface_attach(pointerSurface, buffer, 0, 0); @@ -787,7 +789,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, #if QT_CONFIG(xkbcommon) mRepeatSym = sym; #endif - mRepeatTimer.setInterval(400); + mRepeatTimer.setInterval(mRepeatDelay); mRepeatTimer.start(); } else if (mRepeatCode == code) { mRepeatTimer.stop(); @@ -802,7 +804,7 @@ void QWaylandInputDevice::Keyboard::repeatKey() return; } - mRepeatTimer.setInterval(25); + mRepeatTimer.setInterval(mRepeatRate); sendKey(mFocus->window(), mRepeatTime, QEvent::KeyRelease, mRepeatKey, modifiers(), mRepeatCode, #if QT_CONFIG(xkbcommon) mRepeatSym, mNativeModifiers, @@ -842,6 +844,12 @@ void QWaylandInputDevice::Keyboard::keyboard_modifiers(uint32_t serial, #endif } +void QWaylandInputDevice::Keyboard::keyboard_repeat_info(int32_t rate, int32_t delay) +{ + mRepeatRate = rate; + mRepeatDelay = delay; +} + void QWaylandInputDevice::Touch::touch_down(uint32_t serial, uint32_t time, struct wl_surface *surface, |