Fix selection type when trying to get a selection. Also fix pasting

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>
This commit is contained in:
Chris Michael 2013-11-07 14:26:57 +00:00
parent d2101b918e
commit b3b728acb7
1 changed files with 9 additions and 9 deletions

View 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";