Ticket #390: 390-submersible.patch

File 390-submersible.patch, 1.4 KB (added by submersible_toaster, 5 years ago)
  • lib/Padre/Wx/Editor.pm

     
    869869    my $text = $self->GetSelectedText; 
    870870    if ( Padre::Constant::WXGTK and defined $text and $text ne '' ) { 
    871871 
    872         # Only on X11 based platforms 
    873         #       Wx::wxTheClipboard->UsePrimarySelection(1); 
    874         $self->put_text_to_clipboard($text); 
    875  
    876         #       Wx::wxTheClipboard->UsePrimarySelection(0); 
     872            # Only on X11 based platforms 
     873            #Wx::wxTheClipboard->Open; 
     874            #Wx::wxTheClipboard->UsePrimarySelection(1); 
     875             
     876            #$self->put_text_to_clipboard($text); 
     877            #Wx::wxTheClipboard->UsePrimarySelection(0); 
     878            #Wx::wxTheClipboard->Close(); 
    877879    } 
    878880 
    879881    my $doc = $self->{Document}; 
     
    892894    # It seems that another event is doing something but not within this module. 
    893895    # Please look at ticket #390 for details! 
    894896 
    895     Padre::Current->editor->Paste; 
    896  
     897    Wx::wxTheClipboard->Open; 
     898    Wx::wxTheClipboard->UsePrimarySelection(1); 
     899    my $wm_clip = Wx::TextDataObject->new; 
     900    Wx::wxTheClipboard->GetData($wm_clip); 
     901    Padre::Current->editor->ReplaceSelection($wm_clip->GetText); 
     902    Wx::wxTheClipboard->UsePrimarySelection(0); 
     903    Wx::wxTheClipboard->Close; 
     904     
    897905    my $doc = $self->{Document}; 
    898906    if ( $doc->can('event_on_middle_up') ) { 
    899907        $doc->event_on_middle_up( $self, $event ); 
    900908    } 
    901909 
    902     $event->Skip; 
     910    #$event->Skip; 
    903911    return; 
    904912} 
    905913