Mac clipboard watching bug fixed

master
Allen Webster 2017-11-27 14:14:58 -05:00
parent 62a884bf02
commit 117e61c91f
2 changed files with 3 additions and 3 deletions

View File

@ -608,10 +608,10 @@ osx_step(void){
// NOTE(allen): Frame Clipboard Input // NOTE(allen): Frame Clipboard Input
if (osx_objc.has_clipboard_item){ if (osx_objc.has_clipboard_item){
osxvars.input.clipboard = make_string(osx_objc.clipboard_data, (i32)osx_objc.clipboard_size); frame_input.clipboard = make_string(osx_objc.clipboard_data, (i32)osx_objc.clipboard_size);
} }
else{ else{
osxvars.input.clipboard = null_string; frame_input.clipboard = null_string;
} }
// HACK(allen): Got this all messed up with respect to how everyone else (other OS layers) work // HACK(allen): Got this all messed up with respect to how everyone else (other OS layers) work

View File

@ -185,7 +185,7 @@ static i32 did_update_for_clipboard = true;
if (data != nil){ if (data != nil){
u32 copy_length = data.length; u32 copy_length = data.length;
if (copy_length > 0){ if (copy_length > 0){
if (copy_length + 1 >= osx_objc.clipboard_max){ if (copy_length + 1 > osx_objc.clipboard_max){
osx_free(osx_objc.clipboard_data, osx_objc.clipboard_max); osx_free(osx_objc.clipboard_data, osx_objc.clipboard_max);
osx_objc.clipboard_max = l_round_up_u32(copy_length + 1, KB(4)); osx_objc.clipboard_max = l_round_up_u32(copy_length + 1, KB(4));
osx_objc.clipboard_data = osx_allocate(osx_objc.clipboard_max); osx_objc.clipboard_data = osx_allocate(osx_objc.clipboard_max);