summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_x/xlib
diff options
context:
space:
mode:
authorMichal Pakula vel Rutka <m.pakula@samsung.com>2012-10-10 09:17:21 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-10 09:17:21 +0000
commit0a8bed1b668197c27eb50819bec11e08f822aa8e (patch)
treec385fea7a0e917373dda0dd416a418217c1c64b9 /legacy/ecore/src/lib/ecore_x/xlib
parent311ea71f36a9c667926cd0c71c221ba72a475aac (diff)
From: Michal Pakula vel Rutka <m.pakula@samsung.com>
Subject: [E-devel] [Patch] [Ecore] Allow to send SelectionNotify event if there is no data from XGetWindowProperty. The issue I want to fix is that elementary clipboard does not return paste callback if selection does not contain any data. Currently when ecore_x_window_prop_property_get function is called asking for AnyProperty it returns 0 if there is no data (number of items stored equals 0). This causes ecore_x_event_handle_selection _notify to exit before SelectionNotify event is added and eventually elementary paste callback is not fired. My patch removes this condition and changes behaviour of this function by allowing to add SelectionNotify event even if data returned is empty. SVN revision: 77732
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xlib')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c12
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c4
2 files changed, 6 insertions, 10 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
index 7d685cf..2e780aa 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -1415,14 +1415,10 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
1415 } 1415 }
1416 } 1416 }
1417 else 1417 else
1418 { 1418 format = ecore_x_window_prop_property_get(xevent->xselection.requestor,
1419 format = ecore_x_window_prop_property_get(xevent->xselection.requestor, 1419 xevent->xselection.property,
1420 xevent->xselection.property, 1420 AnyPropertyType, 8, &data,
1421 AnyPropertyType, 8, &data, 1421 &num_ret);
1422 &num_ret);
1423 if (!format)
1424 return;
1425 }
1426 1422
1427 e = calloc(1, sizeof(Ecore_X_Event_Selection_Notify)); 1423 e = calloc(1, sizeof(Ecore_X_Event_Selection_Notify));
1428 if (!e) 1424 if (!e)
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
index e94d5a3..476621a 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
@@ -810,7 +810,7 @@ _ecore_x_selection_parser_files(const char *target,
810 if (!sel) return NULL; 810 if (!sel) return NULL;
811 ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_files_free; 811 ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_files_free;
812 812
813 if (data[size - 1]) 813 if (data && data[size - 1])
814 { 814 {
815 /* Isn't nul terminated */ 815 /* Isn't nul terminated */
816 size++; 816 size++;
@@ -909,7 +909,7 @@ _ecore_x_selection_parser_text(const char *target __UNUSED__,
909 909
910 sel = calloc(1, sizeof(Ecore_X_Selection_Data_Text)); 910 sel = calloc(1, sizeof(Ecore_X_Selection_Data_Text));
911 if (!sel) return NULL; 911 if (!sel) return NULL;
912 if (data[size - 1]) 912 if (data && data[size - 1])
913 { 913 {
914 /* Isn't nul terminated */ 914 /* Isn't nul terminated */
915 size++; 915 size++;