← Back to team overview

kicad-developers team mailing list archive

Re: Strange behavior of draw panel gal focus.

 

Hi Bang,

You need to build KiCad with debug symbols enabled. It can surely be
done using MSYS2 [1], but I think there are developers able to build
KiCad using MS Visual Studio as well. If you prefer the latter, perhaps
someone else can give you some details, I do not know the exact steps.

If you go for MSYS2, then simply run 'gdb path/to/kicad.exe' and the
rest is common gdb debugging. The only exception is Ctrl+C does not work
there, so it is a bit cumbersome to interrupt the program, but it is
possible [2].

Regards,
Orson

1.
http://docs.kicad-pcb.org/doxygen/md_Documentation_development_compiling.html
[Building KiCad on Windows]
2. http://www.mingw.org/wiki/Workaround_for_GDB_Ctrl_C_Interrupt

On 10/31/2017 01:44 AM, Bang He wrote:
> how to debug on win7
> 
> On Mon, Oct 30, 2017 at 9:40 PM, Maciej Sumiński <maciej.suminski@xxxxxxx>
> wrote:
> 
>> Hi Jean-Pierre,
>>
>> Everything works as expected on Linux, with or without the patch. I
>> recall having some other focus problems in the past, so there are more
>> workarounds in common/draw_panel_gal.cpp.
>>
>> Perhaps there is a way to simplify the code related to focus handling or
>> the event handlers setup is incorrect? IIRC, I added the workarounds to
>> make the Tool Dispatcher receive key up/down events.
>>
>> Regards,
>> Orson
>>
>> On 10/30/2017 11:54 AM, jp charras wrote:
>>> Hi Orson,
>>>
>>> Could you have a look into this patch?
>>>
>>> It fixes (this it only a workaround) a very strange behavior of focus,
>> for the draw panel GAL.
>>> Sometimes the draw panel do not have the focus (and moreover do not
>> accept the focus) on W7 32 bits.
>>>
>>> It happens when 2 EDA_FRAME are opened, for instance the board editor
>> and the footprint viewer.
>>>
>>> When the 2 frame are shown on screen, no problem.
>>> But if you iconize one frame (for instance the footprint viewer) the
>> remaining frame does not
>>> receive some events (key events and mousewheel event).
>>>
>>> I had a look into this strange behavior and found 2 problems:
>>> 1 - When happens, the wxWindow::FindFocus() method returns nullptr (that
>> explains why some events
>>> are no longer received)
>>> 2 - And the active draw panel gal does not accept the focus (SetFocus()
>> do nothing). Only the main
>>> Draw Frame accepts SetFocus().
>>>
>>> This small patch gives the Focus to the main Draw Frame when
>> wxWindow::FindFocus() method returns
>>> nullptr.
>>>
>>> More strange:
>>> The first time the footprint viewer is iconized, the focus is lost.
>>> but if you raise and iconize the footprint viewer, the focus is OK.
>>>
>>> In short when iconizing n times the footprint viewer, if n is odd, the
>> focus is lost, and if n is
>>> even, the focus is OK.
>>>
>>> I also noticed (when reading the tool_dispatcher.cpp source) there is a
>> similar focus issue on OSX.
>>>
>>> Perhaps my workaround also fixes this OSX issue.
>>>
>>> Thanks.
>>>
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
> 


Attachment: signature.asc
Description: OpenPGP digital signature


References