Author Topic: FLUID and mouse selection  (Read 8899 times)

Offline AndrewCot

  • Regular
  • ***
  • Posts: 478
Re: FLUID and mouse selection
« Reply #15 on: September 18, 2021, 07:39:54 am »
I have spotted that when doing the following process on Windows:

1) Open Codeblocks
2) Open text file in codeblocks
3) Open the same text file in an external editor (on Windows notepad++ for example)
4) Both editors have to be seen on the screen
5) Modify the text in the external editor and save
6) Left mouse click in codeblocks.
7) The reload dialog appears, say reload yes
8) The wxScintilla code selects text based on the mouse movements.

The wxScintilla::OnMouseLeftUP(...) in wxScintilla.cpp is NOT called after you release the left mouse button in step 6 and as such the code thinks that you still have the left button pressed and therefore are wanting to select the text in step 8, EXCEPT as the file has been modified the file is reloaded and the text selection should not occur.

Sorry, but I am not familiar enough with the code at this point in time to figure out why or what to do next.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 478
Re: FLUID and mouse selection
« Reply #16 on: September 18, 2021, 07:47:42 am »
Looks like this bug has been around for 15 years as the following comment was done 15 years ago in app.cpp lines 1472 through 1480:

        // for some reason a mouse up event doesn't make it into scintilla (scintilla bug)
        // therefore the workaround is not to directly call the editorManager, but
        // take a detour through an event
        // the bug is when the file has been offered to reload, no matter what answer you
        // give the mouse is in a selecting mode, adding/removing things to it's selection as you
        // move it around
        // so : idEditorManagerCheckFiles, EditorManager::OnCheckForModifiedFiles just exist for this workaround
        wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, idEditorManagerCheckFiles);

Hope this is of some use to someone who knows allot more about the code than I do.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3172
Re: FLUID and mouse selection
« Reply #17 on: September 20, 2021, 09:19:28 am »
.... i member to have looked into this, but obviously found no solution...