Menu

#583 Clicking on the frame of a file being opened pastes file's full path at click position

Undefined
fixed
None
Bug_Report
2018-04-28
2017-12-15
Jannick
No

How to reproduce the issue:

  1. Open a project (containing file named, say, f1)
  2. Close f1 if opened
  3. Open f1 by double clicking on f1 in CB's project explorer and immediately click on new frame f1 will be displayed in. 'Immediately' means 'before f1 is displayed'. Use large file to increase the time to open file.
  4. ... path to f1 is pasted at click position (in frame displaying f1)

Using CB svn11246 (nightly build) on Win10.

Discussion

  • bluehazzard

    bluehazzard - 2018-02-12

    Working on SVN 11294 wx3.0.1 WIN7 this is still the case.

    Has someone worked on this problem? The paste does not seem to come from codeblocks, because

    sdk\wxscintilla\src\wxscintilla.cpp:325

    void wxScintilla::InsertText(int pos, const wxString& text)
    

    is not called with the file name text to insert.

     

    Last edit: bluehazzard 2018-02-12
  • bluehazzard

    bluehazzard - 2018-02-12

    I am quite sure this is a drag and drop event happening from the tree ctrl to the editor ctrl.

    i have added a filter for paths in the function and put a breakpoint there
    sdk\wxscintilla\src\scintilla\src\Document.cxx:1011

    int Document::InsertString(int position, const char *s, int insertLength)
    

    If i double click in the tree control and move the pointer to the editor the cursor symbol gets a "drag document" and the breakpoint triggers... I am not able to trigger this in a other way...

    the call stack is as follow:

    #0 ??   Document::InsertString (this=0x48849cd8, position=23878, s=0x40b0d320 "X:\\codeblocks_sf\\src\\src\\app.cpp", insertLength=60) ( codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:1011)
    #1 0x37c33ef    Editor::DropAt(this=0x488360e0, position=..., value=0x4877cad0 "X:\\codeblocks_sf\\src\\src\\app.cpp", lengthValue=60, moving=true, rectangular=false) ( codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:3964)
    #2 0x37c35b2    Editor::DropAt(this=0x488360e0, position=..., value=0x4877cad0 "X:\\codeblocks_sf\\src\\src\\app.cpp", moving=true, rectangular=false) ( codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:3977)
    #3 0x3719dba    ScintillaWX::DoDropText(this=0x488360e0, x=284, y=201, data=...) ( codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:1357)
    #4 0x37151fa    wxSCIDropTarget::OnDropText(this=0x4499b668, x=284, y=201, data=...) ( codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:82)
    #5 0x6a509690   wxTextDropTarget::OnData(int, int, wxDragResult) () ( codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #6 0x6a35bb6d   wxIDropTarget::Drop(IDataObject*, unsigned long, tagPOINT, unsigned long*)@24() ( codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #7 0x76f13c79   ole32!StgGetIFillLockBytesOnFile() (C:\Windows\syswow64\ole32.dll:??)
    #8 0x76f13e78   ole32!StgGetIFillLockBytesOnFile() (C:\Windows\syswow64\ole32.dll:??)
    #9 0x76eeb01d   ole32!OleCreateFromFile() (C:\Windows\syswow64\ole32.dll:??)
    #10 0x76eeaeae  ole32!OleCreateFromFile() (C:\Windows\syswow64\ole32.dll:??)
    #11 0x6a351d3f  wxDropSource::DoDragDrop(int) () ( codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #12 0x14479dc1  CodeSnippets::DoPrjTreeExternalDrag(this=0xdf58d50, pTree=0xdd1d1f0) ( codeblocks_sf\src\plugins\contrib\codesnippets\codesnippets.cpp:1247)
    #13 0x14479699  CodeSnippets::OnPrjTreeMouseLeaveWindowEvent(this=0xdf58d50, event=...) ( codeblocks_sf\src\plugins\contrib\codesnippets\codesnippets.cpp:1181)
    #14 0x6a083282  wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&) ( codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #15 0x28f300    ?? () (??:??)
    #16 ??  ?? () (??:??)
    
     
  • bluehazzard

    bluehazzard - 2018-02-12

    I can confirm, if i remove the drag and drop code in
    sdk\wxscintilla\src\ScintillaWX.cpp:1335

    ScintillaWX::DoDropText(long x, long y, const wxString& data) 
    

    this does bug does not happen.

    The question now is, why does a slow file loading trigger the drag and drop event....

     
  • Teodor Petrov

    Teodor Petrov - 2018-02-12

    I've played a bit with it but I couldn't find anything. Have you tried to reproduce this problem with the scintilla branch and wx-master? What compiler do you use? 32 or 64 bits?

    I think there was a topic on the forum somewhere. Do you have a link?

     
  • bluehazzard

    bluehazzard - 2018-02-12

    yes i remember the forum thread, but i can not find it...

    I only use 32bit builds on a 64bit windows
    Of what scintilla branch are you talking about?

    i am compiling for wx-master right now

     
  • bluehazzard

    bluehazzard - 2018-02-12

    same problem won wx-master. It almost seems that the second mouse release is not registered in time because of the loading....
    But if i try to emulate this by holding the mouse after the second click it does not appear...

     
  • bluehazzard

    bluehazzard - 2018-02-27

    Ok, i think i found the culprit of this bug.. I looked at the back trace at the top and notice the source of the event:

    #11 0x6a351d3f  wxDropSource::DoDragDrop(int) () ( codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #12 0x14479dc1  CodeSnippets::DoPrjTreeExternalDrag(this=0xdf58d50, pTree=0xdd1d1f0) ( codeblocks_sf\src\plugins\contrib\codesnippets\codesnippets.cpp:1247)
    #13 0x14479699  CodeSnippets::OnPrjTreeMouseLeaveWindowEvent(this=0xdf58d50, event=...) ( codeblocks_sf\src\plugins\contrib\codesnippets\codesnippets.cpp:1181)
    #14 0x6a083282  wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&) ( codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll:??)
    #15 0x28f300    ?? () (??:??)
    

    so this comes from the codesnippets plugin. Removing this plugin and the bug is gone. I will look into it...

     
  • bluehazzard

    bluehazzard - 2018-02-28

    This plugin implements a custom drag and drop event generation by tracking the mouse move and button up, down events. I think there are some "race" conditions so that the mouse up event is to late for the plugin and it thinks this is a drag event. It is quite hard do debug, because if i add some logging code the condition is not triggered as often and quite hard to reproduce.

    Solutions: remove this home made drag and drop code and implement the proper wxWidgets way of drag and drop. The question is if this should be implemenetd in the actual project tree manager ctrl or, as it is now, in the plugin.
    I think a generic drag and drop event generator should be integrated in the project tree, generating a drop data object with the path of the file in text format. I am not familiar with drag and drop and i am currently reading into it in wxWidgets. If some one is more familiar with this topic help is welcome!

     

    Last edit: bluehazzard 2018-02-28
  • Jannick

    Jannick - 2018-04-20

    Bug still pertaining in svn 11313.

     
  • bluehazzard

    bluehazzard - 2018-04-20

    This was fixed in [r11345]

     

    Related

    Commit: [r11345]

  • Teodor Petrov

    Teodor Petrov - 2018-04-28
    • status: open --> fixed
    • assigned_to: Teodor Petrov
     
    • Jannick

      Jannick - 2018-05-01

      Fix confirmed in svn 11386 nightly.

      Many thanks !!!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.