[settings] replace XSelectionAtom

the common command line parser should not touch unstable API settings,
so use newly introduced FreeRDP_ClipboardUseSelection
This commit is contained in:
akallabeth 2023-10-19 12:01:03 +02:00 committed by Martin Fleisz
parent 4d99b4ff9b
commit 229916d02e
2 changed files with 8 additions and 4 deletions

View File

@ -2250,9 +2250,12 @@ xfClipboard* xf_clipboard_new(xfContext* xfc, BOOL relieveFilenameRestriction)
clipboard->system = ClipboardCreate();
clipboard->requestedFormatId = -1;
clipboard->root_window = DefaultRootWindow(xfc->display);
selectionAtom = "CLIPBOARD";
if (xfc->common.context.settings->XSelectionAtom)
selectionAtom = xfc->common.context.settings->XSelectionAtom;
selectionAtom =
freerdp_settings_get_string(xfc->common.context.settings, FreeRDP_ClipboardUseSelection);
if (!selectionAtom)
selectionAtom = "CLIPBOARD";
clipboard->clipboard_atom = XInternAtom(xfc->display, selectionAtom, FALSE);
if (clipboard->clipboard_atom == None)

View File

@ -3477,7 +3477,8 @@ static int freerdp_client_settings_parse_command_line_arguments_int(rdpSettings*
if (option_starts_with(usesel, cur))
{
const char* val = &cur[strlen(usesel)];
if (!copy_value(val, &settings->XSelectionAtom))
if (!freerdp_settings_set_string(settings, FreeRDP_ClipboardUseSelection,
val))
rc = COMMAND_LINE_ERROR_MEMORY;
settings->RedirectClipboard = TRUE;
}