I gave it a try again and with the patch below, I think I've solved the problems discussed in this topic.
Please test and report if there are problems with it.
I've tried it only on windows and I will test it on linux in the next couple of days.
The patch should apply to trunk and debuggers branch.
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 7096)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -3348,10 +3348,28 @@
void cbEditor::OnEditorDwellStart(wxScintillaEvent& event)
{
+ if (!wxTheApp->IsActive())
+ return;
+
cbStyledTextCtrl* control = GetControl();
- int pos = control->PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
+
+ wxRect screenRect = control->GetScreenRect();
+ wxPoint ptEvent(event.GetX(), event.GetY());
+ ptEvent = control->ClientToScreen(ptEvent);
+ wxPoint ptScreen = wxGetMousePosition();
+ wxPoint ptClient = control->ScreenToClient(ptScreen);
+
+ double distance = sqrt((ptScreen.x - ptEvent.x) * (ptScreen.x - ptEvent.x)
+ + (ptScreen.y - ptEvent.y) * (ptScreen.y - ptEvent.y));
+ if (!screenRect.Contains(ptScreen) || distance > 10)
+ return;
+
+ int pos = control->PositionFromPoint(ptClient);
int style = control->GetStyleAt(pos);
- NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, event.GetX(), event.GetY());
+ NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, ptClient.x, ptClient.y);
+ wxScintillaEvent newEvent(event);
+ newEvent.SetX(ptClient.x);
+ newEvent.SetY(ptClient.y);
OnScintillaEvent(event);
}