How to reproduce the issue:
- Open a project (containing file named, say, f1)
- Close f1 if opened
- 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.
- ... path to f1 is pasted at click position (in frame displaying f1)
Using CB svn11246 (nightly build) on Win10.
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
is not called with the file name text to insert.
Last edit: 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
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:
I can confirm, if i remove the drag and drop code in
sdk\wxscintilla\src\ScintillaWX.cpp:1335
this does bug does not happen.
The question now is, why does a slow file loading trigger the drag and drop event....
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?
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
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...
One of these two:
https://github.com/obfuscated/codeblocks_sf/tree/scintilla_3_7_5
https://github.com/obfuscated/codeblocks_sf/tree/scintilla_wx_patches
the second has more updates from wxwidgets, but might be more unstable.
For people with this bug: To prevent this bug rest with the mouse in the project manager tree until the file is loaded.
in this branch https://github.com/obfuscated/codeblocks_sf/tree/scintilla_3_7_5 @ https://github.com/obfuscated/codeblocks_sf/commit/269c983de52936de843c3351f92182b47b8397b0 the bug is still present.
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:
so this comes from the codesnippets plugin. Removing this plugin and the bug is gone. I will look into it...
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
some discussion http://forums.codeblocks.org/index.php/topic,22454.msg152860.html#msg152860
TLDR: Code snippets implements a custom drag and drop handler that does not work. This patches use the wxWidgets D&D functionality in the project tree and remove the custom one from the plugin.
Bug still pertaining in svn 11313.
This was fixed in [r11345]
Related
Commit: [r11345]
Fix confirmed in svn 11386 nightly.
Many thanks !!!