Pcbnew: Grid is always shown after start

Bug #1843169 reported by Radovan Blažek
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Low
Ian McInerney

Bug Description

Hi,

if you hide the grid and then restart Pcbnew, the grid shows up.
Also, left toolbar "Display Grid" button is not pressed and "View->Show Grid" checkbox is not checked.

So the GUI widgets remember the state from the last run, but the grid shows up anyway.

Cheers,
Radek

Application: Pcbnew
Version: (5.99.0-96-g2ac270ce8), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.3 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh2/1.8.2 nghttp2/1.39.2
Platform: Linux 5.2.11-arch1-1-ARCH 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 Technology: 7.3.0
    Curl: 7.65.3
    Compiler: GCC 9.1.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=OFF
    KICAD_USE_OCC=ON
    KICAD_SPICE=ON

Tags: pcbnew ui
Changed in kicad:
status: New → Triaged
importance: Undecided → Low
milestone: none → 6.0.0-rc1
tags: added: ui
Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: Triaged → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Novak Tamas (novak-7) wrote :

I don't know what "fix comitted" means, but 14429 nightly (latest download on Nov 10 2019) still has this bug: pcbnew shows the grid after first mouse wheel scroll (even if left buttonbar's top icon not set). Need to toggle the left upper icon on-and-off to hide grid.

Application: Pcbnew
Version: (5.99.0-323-gc4023637d), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    Build date: Nov 8 2019 22:08:49
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.71.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.66.0
    Compiler: GCC 9.2.0 with C++ ABI 1013

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

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

I've also noticed that this appears to be back...

Changed in kicad:
status: Fix Committed → Confirmed
assignee: Jeff Young (jeyjey) → nobody
Revision history for this message
Radovan Blažek (blazra) wrote :

I don't know if I should create new bug report or not, but the Footprint Editor seems to suffer from the same behavior.

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

This is an odd one. I can recreate the footprint viewer grid on startup even though it is disabled. But the Pcbnew one is different. When launched in standalone mode it seems to work (the grid is not displayed when the button is off and zooming doesn't affect it). When launched from the project manager though the button shows the grid on but the display doesn't show the grid until I toggle it. If I close Pcbnew when it is in the on state but not visible, the grid becomes visible the next open.

Changed in kicad:
assignee: nobody → Ian McInerney (imcinerney)
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 69e20c73adda88a19733196be07fc851e6ca6710
https://git.launchpad.net/kicad/patch/?id=69e20c73adda88a19733196be07fc851e6ca6710

Changed in kicad:
status: Confirmed → Fix Committed
Changed in kicad:
status: Fix Committed → Triaged
Revision history for this message
Ian McInerney (imcinerney) wrote :

Ok, I have pushed a fix for the footprint editor grid settings. The pcbnew ones are being caused by our storing of UI values in the board file. The grid settings stored in the Pcbnew configuration are being overwritten when the board file is loaded and it has the grid enabled. It looks like the canvas isn't updated immediately after that happens, so the grid doesn't show up immediately. This begs the question, which UI setting should we use as the master?

I am of the opinion that we should leave the grid visibility to the config file instead of the board file, so the config should override the board file. This would follow the behavior of the ratsnest setting.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ian, given that at some point we are going to remove UI settings from the board file, the config file settings should have precedence over the board settings. We might just want to not even bother setting the config variable in the board parser to prevent any conflict bugs.

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

+1 to ignoring it in the parser.

(And we might even want to stop writing it out.)

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Jeff, eventually we would want to stop writing it out but I would like to make sure we have all of the UI stuff saved in the board file moved into the config files before we remove writing it to the board file. This way we could do it as a single board file format change rather than several incremental file format changes.

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

It is a bit in the visible_elements field since it is a GAL_LAYER as well, so it will be written out as long as all the UI settings are. It is going to be slightly painful to separate it though, since we essentially have to add checks for the getters/setters of the visibility masks (similar to how the ratsnest is currently handled) to make sure anything that tries to update the grid that way works (but I would prefer to remove those code paths and assert if anything tries to use the SetElementVisibility to update the grid visibility and force it only to be updated using the SetGridVisibility function).

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: Triaged → 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.