From 12ec467b576b8445f9f68af9129b1c602fc62443 Mon Sep 17 00:00:00 2001 From: raster Date: Mon, 16 Jul 2012 11:01:44 +0000 Subject: [PATCH] fix e17->elm cnp. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@73924 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 6 ++++++ src/lib/ecore_x/xcb/ecore_xcb_events.c | 10 +++++++++- src/lib/ecore_x/xlib/ecore_x_events.c | 11 ++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45162ba..9e98845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -813,3 +813,9 @@ * Fix ecore-fb string lookup table to include ctrl+keys * Fix ecore-fb to trap sigint (ctrl+c) so it doesnt exit your fb app * Fix ecore-fb mouse to swap button 2 and 3 ro work right. + +2012-07-16 Carsten Haitzler (The Rasterman) + + * Fix ecore-x selection handling to fall back to getting + selection directly if getting targets fails. This fixes e17 to + elm cnp. diff --git a/src/lib/ecore_x/xcb/ecore_xcb_events.c b/src/lib/ecore_x/xcb/ecore_xcb_events.c index 5b7d974..272071f 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_events.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_events.c @@ -1333,7 +1333,15 @@ _ecore_xcb_event_handle_selection_notify(xcb_generic_event_t *event) format = ecore_x_window_prop_property_get(ev->requestor, ev->property, XCB_ATOM_ATOM, 32, &data, &num); - if (!format) return; + if (!format) + { + /* fallback if targets handling is not working and try get the + * selection directly */ + xcb_convert_selection(_ecore_xcb_conn, ev->requestor, + selection, selection, + ECORE_X_ATOM_UTF8_STRING, XCB_CURRENT_TIME); + return; + } } else { diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c index 30a3924..034a1f1 100644 --- a/src/lib/ecore_x/xlib/ecore_x_events.c +++ b/src/lib/ecore_x/xlib/ecore_x_events.c @@ -1403,7 +1403,16 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent) xevent->xselection.property, XA_ATOM, 32, &data, &num_ret); if (!format) - return; + { + /* fallback if targets handling is not working and try get the + * selection directly */ + XConvertSelection(_ecore_x_disp, selection, + ECORE_X_ATOM_UTF8_STRING, + selection, + xevent->xselection.requestor, + CurrentTime); + return; + } } else { -- 2.7.4