diff --git a/.gitignore b/.gitignore index f8c7ac9..ac99682 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ remmina-0.7.5.tar.gz /Remmina-1.0.0.tar.gz /Remmina-26b814aec6e930746d079c885449dd50d3484fb0.tar.gz /Remmina-1470c974cddaede87d09345f712202ddcda0810b.tar.gz +/Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.tar.gz diff --git a/remmina-1.0-clipboard-fix.patch b/remmina-1.0-clipboard-fix.patch new file mode 100644 index 0000000..25f013d --- /dev/null +++ b/remmina-1.0-clipboard-fix.patch @@ -0,0 +1,313 @@ +diff -Naur Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb/remmina-plugins/rdp/rdp_cliprdr.c Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.WORK/remmina-plugins/rdp/rdp_cliprdr.c +--- Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb/remmina-plugins/rdp/rdp_cliprdr.c 2014-07-30 00:07:46.000000000 +0400 ++++ Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.WORK/remmina-plugins/rdp/rdp_cliprdr.c 2014-08-15 20:47:19.713200549 +0400 +@@ -266,12 +266,12 @@ + + data = Stream_Buffer(s); + size = Stream_Length(s); +- Stream_Free(s, TRUE); ++ + pixbuf = gdk_pixbuf_loader_new(); + gdk_pixbuf_loader_write(pixbuf, data, size, NULL); ++ gdk_pixbuf_loader_close(pixbuf, NULL); + Stream_Free(s, TRUE); + output = g_object_ref(gdk_pixbuf_loader_get_pixbuf(pixbuf)); +- gdk_pixbuf_loader_close(pixbuf, NULL); + g_object_unref(pixbuf); + break; + } +@@ -328,7 +328,7 @@ + event = (RDP_CB_DATA_REQUEST_EVENT*) + freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_DataRequest, NULL, NULL); + event->format = rfi->format; +- freerdp_channels_send_event(rfi->channels, (wMessage*) event); ++ freerdp_channels_send_event(rfi->instance->context->channels, (wMessage*) event); + + data = g_async_queue_timeout_pop(rfi->clipboard_queue, 1000000); + if (data != NULL) +@@ -373,16 +373,20 @@ + result = gtk_clipboard_wait_for_targets(clipboard, &targets, &count); + } + +- if (!result) +- return 0; + + event = (RDP_CB_FORMAT_LIST_EVENT*) + freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_FormatList, NULL, NULL); + +- remmina_rdp_cliprdr_get_target_types(&event->formats, &event->num_formats, targets, count); +- g_free(targets); ++ if (result) ++ { ++ remmina_rdp_cliprdr_get_target_types(&event->formats, &event->num_formats, targets, count); ++ g_free(targets); ++ } ++ else ++ event->num_formats = 0; ++ + +- return freerdp_channels_send_event(rfi->channels, (wMessage*) event); ++ return freerdp_channels_send_event(rfi->instance->context->channels, (wMessage*) event); + } + + void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui) +@@ -478,7 +482,7 @@ + freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_DataResponse, NULL, NULL); + event->data = outbuf; + event->size = size; +- freerdp_channels_send_event(rfi->channels, (wMessage*) event); ++ freerdp_channels_send_event(rfi->instance->context->channels, (wMessage*) event); + } + + void remmina_rdp_cliprdr_set_clipboard_data(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui) +diff -Naur Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb/remmina-plugins/rdp/rdp_plugin.c Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.WORK/remmina-plugins/rdp/rdp_plugin.c +--- Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb/remmina-plugins/rdp/rdp_plugin.c 2014-07-30 00:07:46.000000000 +0400 ++++ Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.WORK/remmina-plugins/rdp/rdp_plugin.c 2014-08-15 20:50:39.602705732 +0400 +@@ -212,10 +212,12 @@ + rfContext* rfi; + ALIGN64 rdpSettings* settings; + RemminaProtocolWidget* gp; ++ rdpChannels *channels; + + rfi = (rfContext*) instance->context; + settings = instance->settings; + gp = rfi->protocol_widget; ++ channels = instance->context->channels; + + settings->BitmapCacheEnabled = True; + settings->OffscreenSupportLevel = True; +@@ -254,9 +256,7 @@ + rfi->rfx_context = rfx_context_new(FALSE); + } + +- freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0); +- +- freerdp_channels_pre_connect(rfi->channels, instance); ++ freerdp_channels_pre_connect(instance->context->channels, instance); + + rfi->clrconv = freerdp_clrconv_new(CLRCONV_ALPHA); + +@@ -337,7 +337,7 @@ + instance->update->EndPaint = rf_end_paint; + instance->update->DesktopResize = rf_desktop_resize; + +- freerdp_channels_post_connect(rfi->channels, instance); ++ freerdp_channels_post_connect(instance->context->channels, instance); + + remmina_plugin_service->protocol_plugin_emit_signal(gp, "connect"); + +@@ -464,11 +464,15 @@ + fd_set wfds_set; + rfContext* rfi; + wMessage* event; ++ ++ rdpChannels *channels; ++ + + memset(rfds, 0, sizeof(rfds)); + memset(wfds, 0, sizeof(wfds)); + + rfi = GET_DATA(gp); ++ channels = rfi->instance->context->channels; + + while (1) + { +@@ -479,7 +483,7 @@ + { + break; + } +- if (!freerdp_channels_get_fds(rfi->channels, rfi->instance, rfds, &rcount, wfds, &wcount)) ++ if (!freerdp_channels_get_fds(channels, rfi->instance, rfds, &rcount, wfds, &wcount)) + { + break; + } +@@ -533,13 +537,13 @@ + break; + } + /* check channel fds */ +- if (!freerdp_channels_check_fds(rfi->channels, rfi->instance)) ++ if (!freerdp_channels_check_fds(channels, rfi->instance)) + { + break; + } + else + { +- event = freerdp_channels_pop_event(rfi->channels); ++ event = freerdp_channels_pop_event(channels); + if (event) + remmina_rdp_channels_process_event(gp, event); + } +@@ -572,6 +576,48 @@ + return TRUE; + } + ++int remmina_rdp_load_static_channel_addin(rdpChannels* channels, rdpSettings* settings, char* name, void* data) ++{ ++ void* entry; ++ ++ entry = freerdp_load_channel_addin_entry(name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC); ++ ++ ++ ++ ++ if (entry) ++ { ++ ++ if (freerdp_channels_client_load(channels, settings, entry, data) == 0) ++ { ++ fprintf(stderr, "loading channel %s\n", name); ++ return 0; ++ } ++ } ++ ++ return -1; ++} ++ ++ ++int remmina_rdp_add_static_channel(rdpSettings* settings, int count, char** params) ++{ ++ int index; ++ ADDIN_ARGV* args; ++ ++ args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV)); ++ ++ args->argc = count; ++ args->argv = (char**) malloc(sizeof(char*) * args->argc); ++ ++ for (index = 0; index < args->argc; index++) ++ args->argv[index] = _strdup(params[index]); ++ ++ freerdp_static_channel_collection_add(settings, args); ++ ++ return 0; ++} ++ ++ + static gboolean remmina_rdp_main(RemminaProtocolWidget* gp) + { + gchar* s; +@@ -584,6 +630,8 @@ + const gchar* cs; + RemminaFile* remminafile; + rfContext* rfi; ++ ADDIN_ARGV* args; ++ gint index; + + rfi = GET_DATA(gp); + remminafile = remmina_plugin_service->protocol_plugin_get_file(gp); +@@ -750,7 +798,7 @@ + */ + + /* remmina_rdp_load_plugin(rfi->channels, rfi->settings, "rdpsnd", rfi->rdpsnd_data); */ +- remmina_rdp_load_plugin(rfi->channels, rfi->settings, "rdpsnd", rfi->settings); ++ remmina_rdp_load_plugin(rfi->instance->context->channels, rfi->settings, "rdpsnd", rfi->settings); + /* TODO: Fix/Check this - Removed because of issue #280 + rfi->drdynvc_data[drdynvc_num].size = sizeof(RDP_PLUGIN_DATA); + rfi->drdynvc_data[drdynvc_num].data[0] = "audin"; +@@ -760,12 +808,21 @@ + + if (drdynvc_num) + { +- remmina_rdp_load_plugin(rfi->channels, rfi->settings, "drdynvc", rfi->drdynvc_data); ++ remmina_rdp_load_plugin(rfi->instance->context->channels, rfi->settings, "drdynvc", rfi->drdynvc_data); + } + + if (!remmina_plugin_service->file_get_int(remminafile, "disableclipboard", FALSE)) + { +- remmina_rdp_load_plugin(rfi->channels, rfi->settings, "cliprdr", NULL); ++ ++ if (!freerdp_static_channel_collection_find(rfi->settings, "cliprdr")) ++ { ++ char* params[1]; ++ params[0] = "cliprdr"; ++ remmina_rdp_add_static_channel(rfi->settings, 1, (char**) params); ++ } ++ ++ // Old version: remmina_rdp_load_plugin(rfi->instance->context->channels, rfi->settings, "cliprdr", NULL); ++ + } + + rdpdr_num = 0; +@@ -804,9 +861,19 @@ + if (rdpdr_num) + { + //remmina_rdp_load_plugin(rfi->channels, rfi->settings, "rdpdr", rfi->rdpdr_data); +- remmina_rdp_load_plugin(rfi->channels, rfi->settings, "rdpdr", rfi->settings); ++ remmina_rdp_load_plugin(rfi->instance->context->channels, rfi->settings, "rdpdr", rfi->settings); + } + ++ ++ for (index = 0; index < rfi->settings->StaticChannelCount; index++) ++ { ++ args = rfi->settings->StaticChannelArray[index]; ++ remmina_rdp_load_static_channel_addin(rfi->instance->context->channels, rfi->settings, args->argv[0], args); ++ ++ } ++ ++ ++ + if (!freerdp_connect(rfi->instance)) + { + if (!rfi->user_cancelled) +@@ -817,6 +884,8 @@ + + return FALSE; + } ++ ++ + + remmina_rdp_main_loop(gp); + +@@ -843,6 +912,8 @@ + { + freerdp* instance; + rfContext* rfi; ++ ++ freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0); + + instance = freerdp_new(); + instance->PreConnect = remmina_rdp_pre_connect; +@@ -861,7 +932,7 @@ + rfi->protocol_widget = gp; + rfi->instance = instance; + rfi->settings = instance->settings; +- rfi->channels = freerdp_channels_new(); ++ rfi->instance->context->channels = freerdp_channels_new(); + + pthread_mutex_init(&rfi->mutex, NULL); + +@@ -896,6 +967,7 @@ + { + rfContext* rfi; + freerdp* instance; ++ + + rfi = GET_DATA(gp); + instance = rfi->instance; +@@ -918,11 +990,11 @@ + + if (instance) + { +- if (rfi->channels) ++ if (instance->context->channels) + { + //freerdp_channels_close(rfi->channels, instance); +- freerdp_channels_free(rfi->channels); +- rfi->channels = NULL; ++ freerdp_channels_free(instance->context->channels); ++ instance->context->channels = NULL; + } + if (freerdp_shall_disconnect(instance)) + { +diff -Naur Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb/remmina-plugins/rdp/rdp_plugin.h Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.WORK/remmina-plugins/rdp/rdp_plugin.h +--- Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb/remmina-plugins/rdp/rdp_plugin.h 2014-07-30 00:07:46.000000000 +0400 ++++ Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.WORK/remmina-plugins/rdp/rdp_plugin.h 2014-08-15 20:47:19.714200567 +0400 +@@ -90,7 +90,7 @@ + /* main */ + rdpSettings* settings; + freerdp* instance; +- rdpChannels* channels; ++ // rdpChannels* channels; + + pthread_t thread; + pthread_mutex_t mutex; diff --git a/remmina.spec b/remmina.spec index f62bd3a..5192c20 100644 --- a/remmina.spec +++ b/remmina.spec @@ -1,12 +1,12 @@ # Review at https://bugzilla.redhat.com/show_bug.cgi?id=553402 # https://fedoraproject.org/wiki/Packaging:SourceURL#Github -%global commit 1470c974cddaede87d09345f712202ddcda0810b +%global commit 65d2ca4872150942cced1fbe92248dd933e9c0cb %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: remmina Version: 1.0.0 -Release: 12%{?shortcommit:.git.%{shortcommit}}%{?dist} +Release: 13%{?shortcommit:.git.%{shortcommit}}%{?dist} Summary: Remote Desktop Client License: GPLv2+ and MIT @@ -37,6 +37,9 @@ BuildRequires: libxkbfile-devel BuildRequires: telepathy-glib-devel BuildRequires: vte3-devel +# https://github.com/FreeRDP/Remmina/issues/280#issuecomment-52254273 Thanks to Giovanni Panozzo +Patch0: remmina-1.0-clipboard-fix.patch + # We don't ship the remmina-plugins-common package any longer Provides: remmina-plugins-common = %{version} Obsoletes: remmina-plugins-common < 1.0.0-7 @@ -145,6 +148,8 @@ client. %prep %setup -qn Remmina-%{commit} +%patch0 -p1 -b .clipboard + # Do not install tools into user home directory sed -i \ -e 's@$ENV{HOME}/.%{name}@%{_libexecdir}/%{name}@g' \ @@ -258,7 +263,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files -f %{name}.lang -f %{name}-plugins.lang -%doc AUTHORS ChangeLog COPYING README +%doc AUTHORS ChangeLog LICENSE README %{_bindir}/%{name} %{_datadir}/applications/*.desktop %{_datadir}/icons/hicolor/*/actions/*.* @@ -300,6 +305,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Fri Aug 15 2014 Pavel Alexeev - 1.0.0-13.git.65d2ca4 +- Add Patch0: remmina-1.0-clipboard-fix.patch +- Update to 65d2ca4872150942cced1fbe92248dd933e9c0cb + * Mon Aug 11 2014 Pavel Alexeev - 1.0.0-12.git.1470c97 - Include in devel sub-package for build external plugins: o %%{_libdir}/cmake/%%{name}/*.cmake diff --git a/sources b/sources index 30bf2fe..9bf32ba 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ae43ffbf87654559e7d904da4d328e8f Remmina-1470c974cddaede87d09345f712202ddcda0810b.tar.gz +fffbf18cdbcb280a0d0ae6e4ecf05f03 Remmina-65d2ca4872150942cced1fbe92248dd933e9c0cb.tar.gz