From: duna.oh Date: Thu, 11 May 2023 09:43:52 +0000 (+0900) Subject: e_comp_wl: add function to check if cursor timer is needed to apply X-Git-Tag: accepted/tizen/unified/20230605.170338~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F292862%2F1;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl: add function to check if cursor timer is needed to apply Change-Id: I2ee45838328a2f18056d6fd89c9717dee0160f64 --- diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index c132c7e..b59ca15 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1100,6 +1100,21 @@ _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Client *ec) return ret; } +static Eina_Bool +_e_comp_wl_check_cursor_timer_needed(E_Client *ec) +{ + if (ec->has_cursor_unset) + return EINA_FALSE; + + if (!e_config->show_cursor) + return EINA_FALSE; + + if (!e_config->use_cursor_timer) + return EINA_FALSE; + + return EINA_TRUE; +} + static void _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) { @@ -1123,7 +1138,7 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj return; } - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_IN, ec)) return; @@ -1177,7 +1192,7 @@ _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob return; } - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_OUT, ec)) return; @@ -1362,7 +1377,7 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o } else { - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_MOVE, ec)) return; @@ -1374,7 +1389,7 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o e_pointer_mouse_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y); if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed { - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) _e_comp_wl_cursor_move_timer_control(ec); } } @@ -1436,7 +1451,7 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o } else { - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_DOWN, ec)) return; @@ -1511,7 +1526,7 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *even } else { - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_UP, ec)) return; @@ -1520,7 +1535,7 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *even e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button, WL_POINTER_BUTTON_STATE_RELEASED); - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) _e_comp_wl_cursor_move_timer_control(ec); } @@ -1576,7 +1591,7 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object * if (!eina_list_count(e_comp_wl->ptr.resources)) return; - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, ec)) return; @@ -1588,7 +1603,7 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object * if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed { - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) _e_comp_wl_cursor_move_timer_control(ec); } } @@ -5622,7 +5637,7 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev if (!time) time = e_util_timestamp_get(); serial = wl_display_next_serial(e_comp_wl->wl.disp); - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) { if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, ec)) return EINA_TRUE; @@ -5635,7 +5650,7 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed { - if (!ec->has_cursor_unset && e_config->use_cursor_timer) + if (_e_comp_wl_check_cursor_timer_needed(ec)) _e_comp_wl_cursor_move_timer_control(ec); }