From fb75f6df5a28a048b4e45689e707067faabf8e1e Mon Sep 17 00:00:00 2001 From: indefini Date: Mon, 9 Nov 2015 15:04:27 -0800 Subject: [PATCH] ecore_x: don't add a x selection clear event if the time is the same as when selection was made. Summary: Without this, selection can get cleared when changing focus. For example, if we have 2 entries: The first entry is focused and has a selection. When we focus the second entry, we want to select all the text. But the old selection gets unfocused and sends a clear signal to the new focused entry and it gets unselected. This should fix T2739. Reviewers: raster, tasn, devilhorns Subscribers: herdsman, thiepha, cedric Maniphest Tasks: T2739 Differential Revision: https://phab.enlightenment.org/D3127 Signed-off-by: Cedric BAIL --- src/lib/ecore_x/xlib/ecore_x_events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c index a071d23a05..a560bb8837 100644 --- a/src/lib/ecore_x/xlib/ecore_x_events.c +++ b/src/lib/ecore_x/xlib/ecore_x_events.c @@ -1360,14 +1360,15 @@ _ecore_x_event_handle_property_notify(XEvent *xevent) void _ecore_x_event_handle_selection_clear(XEvent *xevent) { -// Ecore_X_Selection_Intern *d; + Ecore_X_Selection_Intern *d; Ecore_X_Event_Selection_Clear *e; Ecore_X_Atom sel; LOGFN(__FILE__, __LINE__, __FUNCTION__); _ecore_x_last_event_mouse_move = 0; -/* errr..... why? paranoia. d = _ecore_x_selection_get(xevent->xselectionclear.selection); + if (d && (xevent->xselectionclear.time <= d->time)) return; +/* errr..... why? paranoia. if (d && (xevent->xselectionclear.time > d->time)) { _ecore_x_selection_set(None, NULL, 0,