Author Topic: Highlight disappears when using mouse drag scroll with right key  (Read 869 times)

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 66
Highlight disappears when using mouse drag scroll with right key
« on: September 06, 2018, 02:05:03 pm »
- Select "Mouse Key To Use: Right" in Settings-Editor-Mouse Drag Scrolling
- Double click (or select) some repeating word like "std" or "vector" in a file. All "std" highlighted.
- Hold and move (up or down) right key of mouse to scroll. As soon as right key down, highlights disappear.
- Scrolling with mouse wheel ok.
- Using mouse drag scroll with "middle key" instead of "right key" ok. Unfortunatelly I've been using right key :(.

Windows 10, wx3.0.4, svn 11454.

11395 has this problem.
11317 doesn't have this problem.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #1 on: September 06, 2018, 03:14:38 pm »
There is a big gab between your revisions. Can you do a bisect and tell us which revision broke this?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #2 on: September 07, 2018, 08:12:49 am »
11334 has this problem.
11321 does not.

The revisions between them can't be built. I think 11334 fixed error:
Code: [Select]
In file included from F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:51:0:
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp: In member function 'bool ScintillaWX::CreateSystemCaret()':
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:737:27: error: 'sci' was not declared in this scope
     ::ShowCaret(GetHwndOf(sci));
                           ^
F:\wxWidgets-3.0.4\include/wx/msw/private.h:824:42: note: in definition of macro 'GetHwndOf'
 #define GetHwndOf(win)          ((HWND)((win)->GetHWND()))
                                          ^
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp: In member function 'bool ScintillaWX::DestroySystemCaret()':
F:\cb\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:748:31: error: 'sci' was not declared in this scope
         ::HideCaret(GetHwndOf(sci));
                               ^
F:\wxWidgets-3.0.4\include/wx/msw/private.h:824:42: note: in definition of macro 'GetHwndOf'
 #define GetHwndOf(win)          ((HWND)((win)->GetHWND()))

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #3 on: September 07, 2018, 11:15:53 am »
OK, it seems the update of scintilla has caused this.
Unfortunately I cannot reproduce this on my linux, but I had to increase the time for detection of unix context menu.

Does right clicking in the editor clear the selection for you?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #4 on: September 07, 2018, 11:28:48 am »
Yes. But when you right click and "release" button (right click menu pops up), both versions clear the selection.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #5 on: September 07, 2018, 11:51:39 am »
Do you see selection clear only on right button down (if you press and hold the button)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #6 on: September 07, 2018, 11:56:40 am »
Yes, if you press and hold, selection cleared. It has nothing to do with drag scroll then?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #7 on: September 07, 2018, 12:13:31 pm »
No, idea, someone has to debug why this happens.
On linux if I press and hold the selection doesn't clear.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Quiss

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #8 on: September 07, 2018, 01:38:06 pm »
Ok, I've built a fresh one without drag scroll (and without any other contrib plugins), the problem still exists.

One other thing: If you right click and hold onto the initial selection you've made, it's NOT cleared.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #9 on: September 07, 2018, 02:45:25 pm »
One thing you could try is build wxwidgets and the stc sample and try to see if this selection behaviour happens there. If it doesn't then it is something caused by C::B.

A simpler thing is probably testing if this same thing happens in scite.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2060
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #10 on: September 07, 2018, 07:37:37 pm »
i try to look into it. Things i can say so far:
1) The problem is that the selection gets reseted after pressing the right mouse button.
1.1) Normal would be to reset the selection after the release of the mouse button
2) This does not happen before the scintilla update as OP posted the failing revision
3) The wxWidgets 3.0.4 STC sample does not show this behavior --> The selection is not cleared after clicking the right mouse button
4) The selection is not cleared if the right click occurs on top of the selection and the context menu pops open...

i don't know where to search... is this a miss fired event?
I have no contrib plugins activated (only mouse drag and the provided plugins)
« Last Edit: September 07, 2018, 07:39:19 pm by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #11 on: September 07, 2018, 07:49:12 pm »
Probably put a breakpoint in the scintilla calls which handle selections and see why are they called on right-down instead of right-up/press.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2060
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #12 on: September 07, 2018, 07:56:18 pm »
some small update
i can observe that in the old version a wxEVT_SCI_MODIFIED event is fired on the right button release, on the new version on the right button press...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11188
    • Travis build status
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #13 on: September 07, 2018, 10:29:10 pm »
I don't see a modified event posted on right click (on linux).
Can you post the full callstack? What is happening in the modified handler?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2060
Re: Highlight disappears when using mouse drag scroll with right key
« Reply #14 on: September 07, 2018, 11:21:14 pm »
not quite sure if this is the culprit...

Code: [Select]
[debug]#0  cbEditor::OnScintillaEvent (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3441
[debug]#1  0x035b5a91 in cbEditor::OnEditorModified (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3363
[debug]#2  0x0c454074 in wxAppConsoleBase::HandleEvent (this=0x3187a60, handler=0x1828eb80, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x35b57f4 <cbEditor::OnEditorModified(wxScintillaEvent&)>, event=...) at ../../src/common/appbase.cpp:611
[debug]#3  0x0c4540d0 in wxAppConsoleBase::CallEventHandler (this=0x3187a60, handler=0x1828eb80, functor=..., event=...) at ../../src/common/appbase.cpp:623
[debug]#4  0x0c576f8d in wxEvtHandler::ProcessEventIfMatchesId (entry=..., handler=0x1828eb80, event=...) at ../../src/common/event.cpp:1390
[debug]#5  0x0c577bf8 in wxEvtHandler::SearchDynamicEventTable (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1749
[debug]#6  0x0c57742b in wxEvtHandler::TryHereOnly (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1583
[debug]#7  0x0cd6b70c in wxEvtHandler::TryBeforeAndHere (this=0x1828eb80, event=...) at ../../include/wx/event.h:3671
[debug]#8  0x0c577263 in wxEvtHandler::ProcessEventLocally (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1520
[debug]#9  0x0c577204 in wxEvtHandler::ProcessEvent (this=0x1828eb80, event=...) at ../../src/common/event.cpp:1493
[debug]#10 0x0c7aa42a in wxWindowBase::TryAfter (this=0x201c2120, event=...) at ../../src/common/wincmn.cpp:3427
[debug]#11 0x0c57722f in wxEvtHandler::ProcessEvent (this=0x201c2120, event=...) at ../../src/common/event.cpp:1506
[debug]#12 0x03714135 in wxScintilla::NotifyParent (this=0x201c2120, _scn=0x28db5c) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\wxscintilla.cpp:5666
[debug]#13 0x0371777d in ScintillaWX::NotifyParent (this=0x204d1ea0, scn=...) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:498
[debug]#14 0x037d0daa in Editor::NotifyModified (this=0x204d1ea0, mh=...) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:2706
[debug]#15 0x038130b7 in Document::NotifyModified (this=0x204d2698, mh=...) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:2331
[debug]#16 0x03812cf6 in Document::DecorationFillRange(int, int, int)@16 (this=0x204d2698, position=39, value=0, fillLength=2101) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:2288
[debug]#17 0x037e609d in Editor::WndProc (this=0x204d1ea0, iMessage=2505, wParam=0, lParam=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:7458
[debug]#18 0x037eeb1c in ScintillaBase::WndProc (this=0x204d1ea0, iMessage=2505, wParam=0, lParam=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\scintilla\src\ScintillaBase.cxx:1086
[debug]#19 0x03718fed in ScintillaWX::WndProc (this=0x204d1ea0, iMessage=2505, wParam=0, lParam=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\ScintillaWX.cpp:889
[debug]#20 0x03704e39 in wxScintilla::SendMsg (this=0x201c2120, msg=2505, wp=0, lp=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\wxscintilla.cpp:260
[debug]#21 0x0370dc2c in wxScintilla::IndicatorClearRange (this=0x201c2120, start=0, lengthClear=2215) at [...]\codeblocks_sf\src\sdk\wxscintilla\src\wxscintilla.cpp:3800
[debug]#22 0x70a42547 in Highlighter::HighlightOccurrencesOfSelection (this=0x20369c48, ctrl=0x1828eb80) at [...]\codeblocks_sf\src\plugins\occurrenceshighlighting\highlighter.cpp:314
[debug]#23 0x70a4143b in Highlighter::Call (this=0x20369c48, ctrl=0x1828eb80, event=...) at [...]\codeblocks_sf\src\plugins\occurrenceshighlighting\highlighter.cpp:54
[debug]#24 0x70a45e57 in OccurrencesHighlighting::OnEditorHook (this=0x18cb41a8, editor=0x1828eb80, event=...) at [...]\codeblocks_sf\src\plugins\occurrenceshighlighting\occurrenceshighlighting.cpp:352
[debug]#25 0x70a88e10 in EditorHooks::HookFunctor<OccurrencesHighlighting>::Call (this=0x1fe8a860, editor=0x1828eb80, event=...) at include/editor_hooks.h:61
[debug]#26 0x0362567f in EditorHooks::CallHooks (editor=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\editor_hooks.cpp:122
[debug]#27 0x035b648f in cbEditor::OnScintillaEvent (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3464
[debug]#28 0x035b4a4d in cbEditor::OnEditorUpdateUI (this=0x1828eb80, event=...) at [...]\codeblocks_sf\src\sdk\cbeditor.cpp:3181
[debug]#29 0x0c454074 in wxAppConsoleBase::HandleEvent (this=0x3187a60, handler=0x1828eb80, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x35b4966 <cbEditor::OnEditorUpdateUI(wxScintillaEvent&)>, event=...) at ../../src/common/appbase.cpp:611
still debugging..