add checking selection type
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Wed, 15 Sep 2010 13:48:43 +0000 (22:48 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Wed, 15 Sep 2010 13:48:43 +0000 (22:48 +0900)
src/clipdrawer.c
src/xcnphandler.c
src/xcnphandler.h

index c84b8cd..a3cf06d 100644 (file)
@@ -46,15 +46,16 @@ static void _list_click( void *data, Evas_Object *obj, void *event_info )
     elm_list_item_selected_set(it, 0);
 
        char *p = NULL;
-       char *cpdata = NULL;
+//     char *cpdata = NULL;
        int clen;
 
-       cpdata = elm_list_item_label_get(it);
+//     cpdata = elm_list_item_label_get(it);
+       char *cpdata = "#en#";
        if (cpdata == NULL)
                return;
        clen = strlen(cpdata);
        p = malloc(clen + 1);
-       snprintf(p, clen, "%s", cpdata);
+       snprintf(p, clen+1, "%s", cpdata);
        elm_selection_set(1, obj, /*mark up*/1, p);
 
        clipdrawer_lower_view(ad);
index ac64799..b9050e4 100755 (executable)
@@ -63,6 +63,7 @@ static int _init_atoms()
 {
        /* all atoms are global variables */
        atomPrimary = XA_PRIMARY; 
+       atomSecondary = XA_SECONDARY; 
        atomTarget = XA_STRING;
        atomClipboard = XInternAtom(g_disp, ATOM_CLIPBOARD_NAME, False);
        atomCBHM = XInternAtom (g_disp, ATOM_CLIPBOARD_MANAGER_NAME, False);
@@ -337,6 +338,9 @@ static int _xsel_clear_cb(void *data, int ev_type, void *event)
        struct appdata *ad = data;
 
        Ecore_X_Event_Selection_Clear *ev = (Ecore_X_Event_Selection_Clear *)event;
+
+       if (ev->selection != ECORE_X_SELECTION_CLIPBOARD)
+               return TRUE;
        
        DTRACE("SelectionClear\n");
 
@@ -352,6 +356,9 @@ static int _xsel_clear_cb(void *data, int ev_type, void *event)
 static int _xsel_request_cb(void *data, int ev_type, void *event)
 {
        Ecore_X_Event_Selection_Request *ev = (Ecore_X_Event_Selection_Request *)event;
+
+       if (ev->selection != atomClipboard)
+               return TRUE;
        
        DTRACE("SelectionRequest\n");
 
@@ -366,6 +373,9 @@ static int _xsel_notify_cb(void *data, int ev_type, void *event)
 
        Ecore_X_Event_Selection_Notify *ev = (Ecore_X_Event_Selection_Notify *)event;
        Ecore_X_Selection_Data_Text *text_data = NULL;
+
+       if (ev->selection != ECORE_X_SELECTION_CLIPBOARD)
+               return TRUE;
        
        DTRACE("SelectionNotify\n");
 
index f039964..9ea42ae 100755 (executable)
@@ -46,6 +46,7 @@ static Ecore_X_Window g_evtwin = None;
 
 /* all atoms are global variables */
 static Atom atomPrimary;
+static Atom atomSecondary;
 static Atom atomTarget;
 static Atom atomClipboard;
 static Atom atomCBHM;