User forums > Help
Strangeness with stepping in debugger using toolbar button
oBFusCATed:
Pecan thanks for the explanation, but I think that you're wrong :)
I've added this code:
--- Code: --- wxPoint pt;
pt.x = event.GetX();
pt.y = event.GetY();
wxRect edRect = ed->GetClientRect();
wxRect edScreenRect = ed->GetScreenRect();
Log(wxString::Format(wxT("edRect [%d, %d, %d, %d]"), edRect.x, edRect.y, edRect.width, edRect.height));
Log(wxString::Format(wxT("edScreenRect [%d, %d, %d, %d]"),
edScreenRect.x, edScreenRect.y, edScreenRect.width, edScreenRect.height));
Log(wxString::Format(wxT("mouse point [%d, %d]"), pt.x, pt.y));
wxPoint ptReal;
wxGetMousePosition(&ptReal.x, &ptReal.y);
Log(wxString::Format(wxT("mouse point real [%d, %d]\n"), ptReal.x, ptReal.y));
--- End code ---
And see what I'm getting in the log:
--- Quote ---edRect [0, 0, 1185, 653]
edScreenRect [413, 100, 1185, 653]
mouse point [148, 0]
mouse point real [565, 88]
edRect [0, 0, 1185, 653]
edScreenRect [413, 100, 1185, 653]
mouse point [60, 270]
mouse point real [68, 1068]
--- End quote ---
As you can see the mouse has moved after wxScintilla has sent the message.
So to properly fix this, we need to check if the mouse is still inside the editor.
Can you try such fix, because I can't reproduce the next button problem, so I can test it?
Jenna:
I just added some debug-messages and
--- Quote ---PRectangle Window::GetClientPosition() {
if (! wid) return PRectangle();
wxSize sz = GETWIN(wid)->GetClientSize();
return PRectangle(0, 0, sz.x, sz.y);
}
--- End quote ---
always uses the editor control to determine the client-size and not the MainFrame.
And I was not able to get invalid x and y values, the position was always valid.
The only way to get a debugger tooltip, if the mouse is not placed on visible text, is if the left margin hides text.
Jenna:
As you can see the mouse has moved after wxScintilla has sent the message.
So to properly fix this, we need to check if the mouse is still inside the editor.
Can you try such fix, because I can't reproduce the next button problem, so I can test it?
[/quote]
Before showing the tooltip in gdb_commands.h we check whether the mous is inside the rect that contains the text the tooltip belongs to:
--- Code: --- wxPoint mouse_position;
::wxGetMousePosition(&mouse_position.x, &mouse_position.y);
// We show the tooltip only if the user hasn't moved the mouse.
if (m_WinRect.Contains(mouse_position))
{
s_pWin = new GDBTipWindow((wxWindow*)Manager::Get()->GetAppWindow(), m_What, m_Type, m_Address,
contents, 640, &s_pWin, &m_WinRect);
}
--- End code ---
so either the evaluation of the mouse-position or the Contains-function are wrong.
If you have time to check it, please do so, if not I will do it later.
Time for family now :D .
oBFusCATed:
"m_WinRect" is the rect of the selected word/text, so the name is a bit misleading.
And it is possible for this rect to be outside of the window rect of the editor, because there are no checks for this.
Pecan, killerbot: can you add some debug logging and paste the log, when the bug happens?
Jenna:
--- Quote from: oBFusCATed on November 28, 2010, 02:46:28 pm ---"m_WinRect" is the rect of the selected word/text, so the name is a bit misleading.
And it is possible for this rect to be outside of the window rect of the editor, because there are no checks for this.
Pecan, killerbot: can you add some debug logging and paste the log, when the bug happens?
--- End quote ---
What could be done, is make sure, that the points used for the rect are inside the editors window (should not be so hard), but the rect can be very small in this case (if the word is partly invisible).
We can also check whether the mouse is not over one of the left margins (in OnDwellStart), so we can avoid possible problems here, too.
I sometimes also had the same problem and the only way out is to kill gdb and/or the codeblocks into it, and what's more the mouse does not work properly in this case.
But I have debugger tooltips disabled, so the problems seems to be at another place (or there are more possible issues).
We had similar problems (leads to a hang on wxGTK or a crash on windows) due to t a not properly released mouse capture.
I fixrd it by a forced MouseRelease before the modal dialog, that asks whether a changed file should be reloaded was shown.
See this commit: http://svn.berlios.de/wsvn/codeblocks/trunk/src/sdk/editormanager.cpp?op=diff&rev=6845 .
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version