User forums > Help

Strangeness with stepping in debugger using toolbar button

<< < (4/4)

oBFusCATed:
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.


--- Code: ---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);
 }
 

--- End code ---

oBFusCATed:
Anyone tried this? Is it save to commit it?

MortenMacFly:

--- Quote from: oBFusCATed on May 25, 2011, 01:18:58 pm ---Anyone tried this? Is it save to commit it?

--- End quote ---
I tried it since that day, I see no issues, it seems to work. :)

oBFusCATed:
Killerbot, Pecan, Jens: have you tried the patch?

oBFusCATed:
In svn, please test more  :lol:

Navigation

[0] Message Index

[*] Previous page

Go to full version