Windows: fix copy'n paste

Summary: fix seat id and clean cnp data when needed

Test Plan: Ctrl-c and Ctrl-V (elm-->app, app--> elm elm-->elm)

Reviewers: jptiz, walac, cochisecesar, bu5hm4n, felipealmeida, raster

Reviewed By: felipealmeida, raster

Subscribers: netstar, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12166
This commit is contained in:
Vincent Torri 2020-09-30 13:59:27 +01:00 committed by Stefan Schmidt
parent 34be04121d
commit ac6528c9ec
1 changed files with 6 additions and 3 deletions

View File

@ -1219,7 +1219,7 @@ _delivery(void *data, const Eina_Value value EINA_UNUSED, const Eina_Future *dea
}
if (mime_type)
{
edata->clipboard.delivery(ee, 0, ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER, mime_type, &slice);
edata->clipboard.delivery(ee, 1, ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER, mime_type, &slice);
EINA_SAFETY_ON_FALSE_GOTO(ecore_win32_clipboard_set((Ecore_Win32_Window *)ee->prop.window, slice.mem, slice.len, mime_type), end);
}
else
@ -1234,18 +1234,21 @@ end:
static Eina_Bool
_ecore_evas_win32_selection_claim(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Selection_Internal_Delivery delivery, Ecore_Evas_Selection_Internal_Cancel cancel)
{
Ecore_Evas_Engine_Data_Win32 *edata = ee->engine.data;
if (selection != ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER)
return EINA_FALSE;
if (!delivery && !cancel)
{
edata->clipboard.delivery = NULL;
edata->clipboard.cancel = NULL;
eina_array_clean(edata->clipboard.available_types);
ecore_win32_clipboard_clear((Ecore_Win32_Window *)ee->prop.window);
return EINA_TRUE;
}
else
{
Ecore_Evas_Engine_Data_Win32 *edata = ee->engine.data;
if (edata->clipboard.cancel)
{
edata->clipboard.cancel(ee, seat, selection);