raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b0a7c4b086b8b15615a81b811eda9b215608e854

commit b0a7c4b086b8b15615a81b811eda9b215608e854
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Apr 13 04:16:25 2018 +0900

    elm entry - fix wayland bug by not updating selection until after mse up
    
    or update with a small delay after any change and check mouse button
    mask to avoid some bizarre mouse up event that is stopping the
    selection form continuing with a mouse up event... so this works
    around that and still works.
---
 src/lib/elementary/elm_entry.c        | 27 ++++++++++++++++++++++-----
 src/lib/elementary/elm_widget_entry.h |  1 +
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 9e0c64754c..a158939f6b 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -103,6 +103,7 @@ struct _Mod_Api
 
 static void _create_selection_handlers(Evas_Object *obj, Elm_Entry_Data *sd);
 static void _magnifier_move(void *data);
+static Eina_Bool _entry_selection_changed_signal_job_cb(void *data);
 
 static Evas_Object *
 _entry_win_get(Evas_Object *obj)
@@ -2054,6 +2055,8 @@ _mouse_up_cb(void *data,
                     elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
                }
           }
+        if (sd->sel_change_timeout) ecore_timer_del(sd->sel_change_timeout);
+        sd->sel_change_timeout = ecore_timer_add(0.02, 
_entry_selection_changed_signal_job_cb, data);
      }
   /* Since context menu disabled flag was checked at mouse right key down,
    * hence the same should be stopped at mouse up of right key as well */
@@ -2324,25 +2327,37 @@ _entry_selection_none_signal_cb(void *data,
 //   return win && elm_win_wl_window_get(win);
 //}
 
-static void
-_entry_selection_changed_signal_cb(void *data,
-                                   Evas_Object *obj EINA_UNUSED,
-                                   const char *emission EINA_UNUSED,
-                                   const char *source EINA_UNUSED)
+static Eina_Bool
+_entry_selection_changed_signal_job_cb(void *data)
 {
    ELM_ENTRY_DATA_GET(data, sd);
 
    if (!sd) return;
+   sd->sel_change_timeout = NULL;
    sd->have_selection = EINA_TRUE;
    efl_event_callback_legacy_call
      (data, EFL_UI_EVENT_SELECTION_CHANGED, NULL);
    // XXX: still try primary selection even if on wl in case it's
    // supported
 //   if (!_entry_win_is_wl(data))
+   if 
(!evas_pointer_button_down_mask_get(evas_object_evas_get(sd->entry_edje)))
      _selection_store(ELM_SEL_TYPE_PRIMARY, data);
    _update_selection_handler(data);
    if (_elm_config->atspi_mode)
      efl_access_event_emit(EFL_ACCESS_MIXIN, data, 
EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_SELECTION_CHANGED, NULL);
+   return EINA_FALSE;
+}
+
+static void
+_entry_selection_changed_signal_cb(void *data,
+                                   Evas_Object *obj EINA_UNUSED,
+                                   const char *emission EINA_UNUSED,
+                                   const char *source EINA_UNUSED)
+{
+   ELM_ENTRY_DATA_GET(data, sd);
+
+   if (sd->sel_change_timeout) ecore_timer_del(sd->sel_change_timeout);
+   sd->sel_change_timeout = ecore_timer_add(0.02, 
_entry_selection_changed_signal_job_cb, data);
 }
 
 static void
@@ -3959,6 +3974,8 @@ _elm_entry_efl_canvas_group_group_del(Eo *obj, 
Elm_Entry_Data *sd)
 
    eina_stringshare_del(sd->file);
 
+   ecore_timer_del(sd->sel_change_timeout);
+   sd->sel_change_timeout = NULL;
    ecore_job_del(sd->hov_deljob);
    if ((sd->api) && (sd->api->obj_unhook))
      sd->api->obj_unhook(obj);  // module - unhook
diff --git a/src/lib/elementary/elm_widget_entry.h 
b/src/lib/elementary/elm_widget_entry.h
index a40df5183b..cf5e0fb978 100644
--- a/src/lib/elementary/elm_widget_entry.h
+++ b/src/lib/elementary/elm_widget_entry.h
@@ -71,6 +71,7 @@ struct _Elm_Entry_Data
    Edje_Cursor                           sel_handler_cursor;
    void                                 *input_panel_imdata;
    Eina_List                            *edje_signals;
+   Ecore_Timer                          *sel_change_timeout;
    int                                   input_panel_imdata_len;
    int                                   input_panel_layout_variation;
    int                                   validators;

-- 


Reply via email to