From 242b6e1e3d020e8d36325821e15984ae84c673b1 Mon Sep 17 00:00:00 2001 From: jdolan Date: Thu, 4 Jul 2013 22:40:41 -0400 Subject: [PATCH] #196 Workaround to get internal clipboard working on Mac. Even if retrieving the selection from the OS fails, if we still have something in the local clipboard buffer, use it. This at least restores the standard copy-paste workflow within the editor. @TTimo please review. --- radiant/mainframe.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 3d94b5d4..77c2a458 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -2110,12 +2110,13 @@ static void clipboard_clear( GtkClipboard *clipboard, gpointer user_data_or_owne } static void clipboard_received( GtkClipboard *clipboard, GtkSelectionData *data, gpointer user_data ){ - g_Clipboard.SetLength( 0 ); + //g_Clipboard.SetLength( 0 ); if ( data->length < 0 ) { Sys_FPrintf( SYS_ERR, "Error retrieving selection\n" ); } else if ( strcmp( gdk_atom_name( data->type ), clipboard_targets[0].target ) == 0 ) { + g_Clipboard.SetLength( 0 ); g_Clipboard.Write( data->data, data->length ); }