Fix selection type when trying to get a selection. Also fix pasting
authorChris Michael <cp.michael@samsung.com>
Thu, 7 Nov 2013 14:26:57 +0000 (14:26 +0000)
committerChris Michael <cp.michael@samsung.com>
Thu, 7 Nov 2013 14:31:57 +0000 (14:31 +0000)
from terminology into other elm apps (selection format issue).

Wayland has no concept of primary or secondary clipboards so we need
to test for selection == those due to some X apps.

*cough*terminology*cough* using only Primary or Secondary.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
legacy/elementary/src/lib/elm_cnp.c

index a40f87b..0b6ac7d 100644 (file)
@@ -2276,15 +2276,14 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
              const char *types[10] = {0, };
              int i = -1;
 
-             if (format & ELM_SEL_FORMAT_TEXT)
+             if ((format & ELM_SEL_FORMAT_MARKUP) || 
+                 (format & ELM_SEL_FORMAT_TEXT))
                {
+                  types[++i] = "application/x-elementary-markup";
                   types[++i] = "text/plain";
                   types[++i] = "text/plain;charset=utf-8";
                }
 
-             if (format & ELM_SEL_FORMAT_MARKUP)
-               types[++i] = "application/x-elementary-markup";
-
              if (format & ELM_SEL_FORMAT_HTML)
                {
                   types[++i] = "text/html";
@@ -2335,20 +2334,21 @@ _wl_elm_cnp_selection_get(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
                                   EVAS_CALLBACK_DEL, _wl_sel_obj_del2, 
                                   &wl_cnp_selection);
 
-   if (selection == ELM_SEL_TYPE_CLIPBOARD)
+   if ((selection == ELM_SEL_TYPE_CLIPBOARD) || 
+       (selection == ELM_SEL_TYPE_PRIMARY) || 
+       (selection == ELM_SEL_TYPE_SECONDARY))
      {
         const char *types[10] = {0, };
         int i = -1;
 
-        if (format & ELM_SEL_FORMAT_TEXT)
+        if ((format & ELM_SEL_FORMAT_MARKUP) || 
+            (format & ELM_SEL_FORMAT_TEXT))
           {
+             types[++i] = "application/x-elementary-markup";
              types[++i] = "text/plain";
              types[++i] = "text/plain;charset=utf-8";
           }
 
-        if (format & ELM_SEL_FORMAT_MARKUP)
-          types[++i] = "application/x-elementary-markup";
-
         if (format & ELM_SEL_FORMAT_HTML)
           {
              types[++i] = "text/html";