e_devicemgr_input: Do not allow warp pointer (cursor) outside the compositor canvas 45/319745/1
authorduna.oh <duna.oh@samsung.com>
Mon, 17 Feb 2025 04:25:50 +0000 (13:25 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 17 Feb 2025 07:40:06 +0000 (16:40 +0900)
Change-Id: I3ef22600b18bdce9ca9c4476324524a390d10d90

src/bin/inputmgr/e_devicemgr_input.c

index 45dec58dde23134b4479cbe28be662e08b447893..e8338c3e60fb821b3ac467b2e9971f484c4d52f6 100644 (file)
@@ -34,6 +34,14 @@ e_devicemgr_strcmp(const char *dst, const char *src)
 static int
 _e_devicemgr_input_pointer_warp(int x, int y)
 {
+   int comp_w = 0, comp_h = 0;
+   e_comp_size_get(&comp_w, &comp_h);
+
+   if (x < 0) x = 0;
+   else if (x > comp_w - 1) x = comp_w - 1;
+   if (y < 0) y = 0;
+   else if (y > comp_h - 1) y = comp_h - 1;
+
    e_input_device_pointer_warp(NULL, x, y);
    DMWRN("The pointer warped to (%d, %d) !\n", x, y);