DSWaylandServer: fix to use wl_array pointer to following changes of dswayland-server... 97/241797/1
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 12 Aug 2020 08:43:13 +0000 (17:43 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:10:56 +0000 (19:10 +0900)
Change-Id: If368b1b8bf186ee64e2a3c3970d633a41a6dc8d5
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
src/DSWaylandServer/DSWaylandKeyboard.cpp
src/DSWaylandServer/DSWaylandKeyboardPrivate.h
src/DSWaylandServer/DSWaylandTextInput.cpp
src/DSWaylandServer/DSWaylandTizenInputDeviceManager.cpp

index eaae9ca..85fa455 100644 (file)
@@ -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);
                }
        };
 
index 98eed2a..f3be21d 100644 (file)
@@ -72,7 +72,7 @@ private:
 
        uint32_t __repeatRate;
        uint32_t __repeatDelay;
-       std::string __keys;
+       struct ::wl_array __keys;
 
        int __fdKeymap;
        uint32_t __fdKeymapSize;
index 4f3855b..29ea673 100644 (file)
@@ -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)
index 0ef1347..d30d185 100644 (file)
@@ -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);
 }