From 51d0efd3dc171d0306be1c2b779101c318b5c0f4 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Wed, 12 Aug 2020 17:43:13 +0900 Subject: [PATCH] DSWaylandServer: fix to use wl_array pointer to following changes of dswayland-server header Change-Id: If368b1b8bf186ee64e2a3c3970d633a41a6dc8d5 Signed-off-by: Junseok, Kim --- src/DSWaylandServer/DSWaylandKeyboard.cpp | 6 ++++-- src/DSWaylandServer/DSWaylandKeyboardPrivate.h | 2 +- src/DSWaylandServer/DSWaylandTextInput.cpp | 10 +++++++++- src/DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp | 7 +++++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/DSWaylandServer/DSWaylandKeyboard.cpp b/src/DSWaylandServer/DSWaylandKeyboard.cpp index eaae9ca..85fa455 100644 --- a/src/DSWaylandServer/DSWaylandKeyboard.cpp +++ b/src/DSWaylandServer/DSWaylandKeyboard.cpp @@ -72,13 +72,15 @@ DSWaylandKeyboardPrivate::DSWaylandKeyboardPrivate(DSWaylandSeat *seat, DSWaylan __fdKeymap, __fdKeymapSize, __formatKeymap); wl_keyboard(); - __keys.clear(); + wl_array_init(&__keys); } DSWaylandKeyboardPrivate::~DSWaylandKeyboardPrivate() { if (__fdKeymap >= 0) close(__fdKeymap); + + wl_array_release(&__keys); } void DSWaylandKeyboardPrivate::keyboard_bind_resource(Resource *resource) @@ -121,7 +123,7 @@ void DSWaylandKeyboardPrivate::sendEnter(struct ::wl_resource *surface) { if (res.first == client) { - send_enter(res.second->handle, __compositor->nextSerial(), surface, __keys); + send_enter(res.second->handle, __compositor->nextSerial(), surface, &__keys); } }; diff --git a/src/DSWaylandServer/DSWaylandKeyboardPrivate.h b/src/DSWaylandServer/DSWaylandKeyboardPrivate.h index 98eed2a..f3be21d 100644 --- a/src/DSWaylandServer/DSWaylandKeyboardPrivate.h +++ b/src/DSWaylandServer/DSWaylandKeyboardPrivate.h @@ -72,7 +72,7 @@ private: uint32_t __repeatRate; uint32_t __repeatDelay; - std::string __keys; + struct ::wl_array __keys; int __fdKeymap; uint32_t __fdKeymapSize; diff --git a/src/DSWaylandServer/DSWaylandTextInput.cpp b/src/DSWaylandServer/DSWaylandTextInput.cpp index 4f3855b..29ea673 100644 --- a/src/DSWaylandServer/DSWaylandTextInput.cpp +++ b/src/DSWaylandServer/DSWaylandTextInput.cpp @@ -672,13 +672,21 @@ void DSWaylandTextInputPrivate::sendCursorPosition(int index, int anchor) void DSWaylandTextInputPrivate::sendModifiersMap(std::string map) { + struct ::wl_array map_data; + if (!__activatedResource) { DSLOG_WRN("DSWaylandTextInput", "No Text Input For Resource"); return; } - send_modifiers_map(__activatedResource->handle, map); + wl_array_init(&map_data); + char *strptr = (char *)wl_array_add(&map_data, map.length()); + std::copy(map.c_str(), map.c_str() + map.length(), strptr); + + send_modifiers_map(__activatedResource->handle, &map_data); + + wl_array_release(&map_data); } void DSWaylandTextInputPrivate::sendKeysym(unsigned int serial, unsigned int time, unsigned int sym, unsigned int state, unsigned int modifiers) diff --git a/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp b/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp index 0ef1347..d30d185 100644 --- a/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp +++ b/src/DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp @@ -165,9 +165,12 @@ void *DSWaylandTizenInputDevicePrivate::addDevice(void *client, DSInputDevice *d void DSWaylandTizenInputDevicePrivate::sendDeviceInfo(void *resource, DSInputDevice *device) { - std::string axes; + struct ::wl_array axes; + wl_array_init(&axes); - send_device_info((struct ::wl_resource *)resource, device->getName(), (uint32_t)device->getClass(), (uint32_t)device->getSubclass(), axes); + send_device_info((struct ::wl_resource *)resource, device->getName(), (uint32_t)device->getClass(), (uint32_t)device->getSubclass(), &axes); + + wl_array_release(&axes); } -- 2.7.4