#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.

This commit is contained in:
jdolan 2013-07-04 22:40:41 -04:00
parent b992d051fb
commit 31ad3cbdeb

View file

@ -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 );
}