From: duna.oh Date: Wed, 5 Jun 2024 12:10:02 +0000 (+0900) Subject: e_comp_wl_input: clip the cursor hint position to inside of the window X-Git-Tag: accepted/tizen/8.0/unified/20240610.163446~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F312407%2F2;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl_input: clip the cursor hint position to inside of the window The cursor hint position should be bound to (0,0 ~ width - 1,height - 1). Refer to the commit: 11f283d31560c5142ea489f582cd95ab87b85480 Change-Id: Ic0b2312b20b045cf1ed9b5d56c752da16211d79a --- diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 593b275605..ceba325f99 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -813,8 +813,17 @@ _e_comp_wl_input_cb_pointer_constraints_surface_committed(struct wl_listener *li { constraint->is_hint_pending = EINA_FALSE; - new_x = ec->client.x + wl_fixed_to_int(constraint->hint_x_pending); - new_y = ec->client.y + wl_fixed_to_int(constraint->hint_y_pending); + new_x = wl_fixed_to_int(constraint->hint_x_pending); + new_y = wl_fixed_to_int(constraint->hint_y_pending); + + if (new_x < 0) new_x = 0; + if ((ec->w != 0) && (new_x > ec->w - 1)) new_x = ec->w - 1; + + if (new_y < 0) new_y = 0; + if ((ec->h != 0) && (new_y > ec->h - 1)) new_y = ec->h - 1; + + new_x = ec->client.x + new_x; + new_y = ec->client.y + new_y; if (e_client_transform_core_enable_get(ec)) {