Route menu actions start immediately on GTK

Bug #1835672 reported by Ian McInerney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Undecided
Jeff Young

Bug Description

When you select "Route Single Track" from the Route menu in the menu bar, it immediately places the first point in the trace where the mouse is (which is outside the editor window).

Also, when you select "Route Differential Pair" from the route menu, it immediately gives you a dialog saying that you cannot route it in the middle of nowhere.

It seems these two actions are actually trying to start routing a trace immediately rather than wait for the user to click the mouse in the board editor.

Application: Pcbnew
Version: (5.1.0-1220-ga8c7e65ea-dirty), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.7/openssl/zlib nghttp2/1.37.0
Platform: Linux 5.1.15-300.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: Clang 8.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: pcbnew
Revision history for this message
Jeff Young (jeyjey) wrote :

It's very hard to tell a menu item selection from a hotkey in wxWidgets. We have a hack which checks to see if the menu is highlighted to determine if it's a menu selection. This is in ACTION_MENU::OnMenuEvent(). It works for OSX; this bug report would suggest it does not work for GTK. I'm not sure about MSW.

Revision history for this message
Jeff Young (jeyjey) wrote :

Note: it's SetHasPosition() which tells the rest of the code it's a menu event (ie: the location at the time of the event is not defined).

Jeff Young (jeyjey)
summary: - Route menu actions start immediately
+ Route menu actions start immediately on GTK
Revision history for this message
Jeff Young (jeyjey) wrote :

I've put in something that /might/ address this. Could someone test it on GTK?

Changed in kicad:
milestone: none → 6.0.0-rc1
assignee: nobody → Jeff Young (jeyjey)
status: New → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 4852c91b423abf1e3e745f9d17ad56c92d5445b8
https://git.launchpad.net/kicad/patch/?id=4852c91b423abf1e3e745f9d17ad56c92d5445b8

Changed in kicad:
status: In Progress → Fix Committed
Jeff Young (jeyjey)
Changed in kicad:
status: Fix Committed → In Progress
Revision history for this message
Seth Hillbrand (sethh) wrote :

Works nicely here. Clever solution!

Application: Pcbnew
Version: (5.1.0-1213-g44734dc05-dirty), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Ian McInerney (imcinerney) wrote :

Yep, it looks like that fixed it.

Jeff Young (jeyjey)
Changed in kicad:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.