DSWaylandPointer: fix to return if there is no resource for pointer 59/242759/1
authorSung-Jin Park <sj76.park@samsung.com>
Fri, 28 Aug 2020 04:22:13 +0000 (13:22 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 1 Sep 2020 01:29:21 +0000 (10:29 +0900)
Change-Id: I955b3a312323f3b3327f1bc67848ca137c160fd2
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSWaylandServer/DSWaylandPointer.cpp

index 186c5cd..f298c43 100644 (file)
@@ -124,6 +124,9 @@ void DSWaylandPointerPrivate::pointer_release(Resource *resource)
 
 void DSWaylandPointerPrivate::sendEnter(struct ::wl_resource *wlResource, struct ::wl_resource *surface, int surface_x, int surface_y)
 {
+       if (!__wlPointerResource)
+               return;
+
        wl_fixed_t surface_x_fixed = wl_fixed_from_int(surface_x);
        wl_fixed_t surface_y_fixed = wl_fixed_from_int(surface_y);
 
@@ -132,11 +135,17 @@ void DSWaylandPointerPrivate::sendEnter(struct ::wl_resource *wlResource, struct
 
 void DSWaylandPointerPrivate::sendLeave(struct ::wl_resource *wlResource, struct ::wl_resource *surface)
 {
+       if (!__wlPointerResource)
+               return;
+
        send_leave(__wlPointerResource, __compositor->nextSerial(), surface);
 }
 
 void DSWaylandPointerPrivate::sendMotion(int surface_x, int surface_y)
 {
+       if (!__wlPointerResource)
+               return;
+
        wl_fixed_t surface_x_fixed = wl_fixed_from_int(surface_x);
        wl_fixed_t surface_y_fixed = wl_fixed_from_int(surface_y);
 
@@ -145,6 +154,9 @@ void DSWaylandPointerPrivate::sendMotion(int surface_x, int surface_y)
 
 void DSWaylandPointerPrivate::sendButton(uint32_t button, uint32_t state)
 {
+       if (!__wlPointerResource)
+               return;
+
        send_button(__wlPointerResource, __compositor->nextSerial(), __seat->getCurrentEventTime(), button, state);
 }