DSWaylandCompositor: add getSurface function by wl_resource 97/242797/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Fri, 28 Aug 2020 10:34:46 +0000 (19:34 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 1 Sep 2020 01:29:59 +0000 (10:29 +0900)
Change-Id: Ia4003f15101bcd1261f927b6497ff54fc42132fc
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/DSWaylandServer/DSWaylandCompositor.cpp
src/DSWaylandServer/DSWaylandCompositor.h

index f09ef05..438cfd2 100644 (file)
@@ -519,6 +519,19 @@ DSWaylandSurface *DSWaylandCompositor::getSurface(uint32_t id)
        return nullptr;
 }
 
+DSWaylandSurface *DSWaylandCompositor::getSurface(struct ::wl_resource *surface)
+{
+       for (auto s : __surfaceList)
+       {
+               if (s->getWlResource() == surface)
+               {
+                       return s.get();
+               }
+       }
+
+       return nullptr;
+}
+
 void DSWaylandCompositor::sendSurfaceDestroy(DSWaylandSurface *dswSurface)
 {
        for (auto s : __surfaceList)
index b350f48..6e89344 100644 (file)
@@ -30,6 +30,7 @@
 #include <mutex>
 
 struct wl_display;
+struct wl_resource;
 
 namespace display_server
 {
@@ -68,6 +69,7 @@ public:
        IDSWaylandShell *getShell(void);
 
        DSWaylandSurface *getSurface(uint32_t id);
+       DSWaylandSurface *getSurface(struct ::wl_resource *surface);
 
        void sendSurfaceDestroy(DSWaylandSurface *dswSurface);
        void regionDestroy(DSWaylandRegion *dswRegion);