The old restore dialog only showed a simple list of snapshots
so it was hard to see what each entry contained before
restoring. It also had a bug where pressing Restore could
close the dialog but not restore anything, because the
pre-restore backup step treated no changes to save as a faliure.
This change adds a dedicated restore dialog that shows the
snapshot time, summary, hash, and changed files. It also
updates the restore code to load snapshot details for the
dialog and to continue with the restore when the backup
step finds no new changes.
Flip Board View did not work correctly when it was added to a
custom toolbar. The board flip worked from the view menu or
appearance panel.
This change stores the board flip state in PCB_DISPLAY_OPTIONS
and applies it through SetDisplayOptions(), the same way other
display toggles are handled. The toolbar, menu, and appearance
panel now use the same state, so Flip Board View works correctly
from custom toolbars.
* add VARIANT and VARIANT_DESC to the list of known vars in the drawing
sheet editor.
* cache variant and variant description in respective objects.
* expand the respective text variables when building the drawing sheet.
* keep the cached variant and its description up-to-date when selecting
a variant in the GUI.
* pass variant and its description to the plotters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23430
The knockout algo was a post-processing step, but it
only knew about the poly representation, and not the
new line segment optimization. Since the post-process
step proved to be fragile, knockouts are now fetched
from a callback from EDA_SHAPE::UpdateHatching().
Savers now serialize to in-memory HISTORY_FILE_DATA on the UI thread,
then Prettify + file writes + git stage/diff/commit run on a background
thread via GetKiCadThreadPool(). An atomic skip-if-busy flag prevents
overlapping saves; WaitForPendingSave() ensures clean shutdown.
Extracted FormatBoardToFormatter and FormatSchematicToFormatter so
SaveToHistory can serialize without touching disk. PROJECT savers use
sourcePath for file-copy semantics since project files are small.
WebKit's AddScriptMessageHandler calls RunScript internally,
which yields the event loop via DoYieldFor. When this runs
inside a nested event loop (e.g., Update PCB from Schematic's
modal dialog), JSC crashes in sanitizeStackForVM.
The previous fix used CallAfter to defer handler registration,
but CallAfter events fire immediately in the modal dialog's
event loop, creating a tight busy-wait that freezes the UI.
Replace CallAfter re-deferral with a wxTimer that retries
every 200ms until the main event loop is active. Also guard
AddMessageHandler's late-registration path with the same
nested loop check so handlers added after init are safe too.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23423
During LoadExistingRules, each call to AppendNewRuleTreeItem
triggered SelectItem, which fired the selection-changed handler.
That handler created a full PANEL_DRC_RULE_EDITOR per rule,
compiling 14 regex patterns, instantiating Scintilla, running
layout, then immediately destroying it when the next rule was
appended. Also fix other potential slow downs
Extract duplicated helpers from remote provider files into shared
utilities. Split sendRpcMessage into purpose-specific functions.
Implement standard nonce-based exchange for re-auth. Provide
additional models for more efficient model/symbol/fp/etc using
external URLs. This allows us to better handle connection errors,
retries and large data packets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23381
Intersecting and fracturing zone fills takes forever for complex
fills (VCU118 has some fills severa with hundreds of thousands of
points).
However, they are trivially parallelisable - so do that and cut VCU
board load times by 70% - YMMV depending on CPU.
Further save 10% by sorting the heaviest zones first which is nice,
but the real thing to avoid is accidentally scheduling the biggest
zones consecutively on the same thread, which could be a substantial
penalty.
This has the happy effect of reducing the Allegro test suite to under
a minute (VCU118 dominates)
The BOM revision in IPC-2581 export was hardcoded to "1.0"
instead of reflecting the actual design revision.
The project file stores two separate fields: bomRev for
explicit user overrides set in the PCBnew export dialog or
via --bom-rev on the CLI, and schRevision for the value
auto-propagated from eeschema.
When the GPU context is invalidated by sleep/wake or a driver
reset, glMapBuffer fails with GL_OUT_OF_MEMORY and the renderer
permanently falls back to Cairo. Instead, attempt a full OpenGL
GAL reinit once before giving up. SwitchBackend recreates all
GPU resources and SetGAL triggers clearGroupCache so every
cached item is regenerated on the next frame. A flag prevents
infinite retry loops and resets after each successful paint.
LAYER_RANGE enters an infinite loop when constructed with
layer_count < 2. The next_layer() arithmetic underflows,
producing unreachable termination values, so the iterator
increments forever. This happens during board import when a
file produces a board with zero copper layers.
Clamp layer_count to a minimum of 2 in the LAYER_RANGE
constructor since F_Cu and B_Cu are always present.
Add content validation to the Fabmaster plugin, which
previously accepted any .txt file based on extension alone.
CanReadBoard now scans for !-delimited rows containing
known Fabmaster column headers before claiming the file.
Background library loading threads call GetRow() through
loadFromScope(), which writes to m_rowCache concurrently
with the main thread clearing it in loadTables(). The
unsynchronized access corrupts the map's red-black tree,
causing a double-free crash when switching projects.
Add m_rowCacheMutex to protect all m_rowCache accesses.
Also replace std::tie with std::make_tuple to avoid
unnecessary temporary conversions, and use a single
find() instead of contains() followed by at().
Add an aAllowSkip parameter to DoRePaint that gates both skip
checks. onPaint and ForceRefresh pass false so they always
execute the full GL/Cairo cycle. The rate-limited Refresh path
continues to pass true (the default), preserving the GPU
utilization improvement from b728c08b7a.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23325
Initializing m_last to time_point::min() causes signed integer
overflow when computing now - m_last, since the nanosecond
difference exceeds int64_t range. Initialize to now - interval
instead so the first Ready() call passes naturally.
Add m_hasPendingItemUpdates to VIEW so UpdateItems() can
return immediately when no item has queued update flags.
The flag is set wherever m_requiredUpdate is modified and
cleared at the end of UpdateItems().
In DoRePaint(), check the new flag alongside IsDirty() and
cursor movement to skip both item processing and the GL
draw cycle when nothing has changed. Route onPaint through
Refresh() so the existing frame-rate throttle applies to
native paint events as well.
Five call sites independently reimplemented the same
time-gated throttle pattern. This consolidates them all
into a single THROTTLE class backed by steady_clock.
Three call sites duplicated the wxWidgets YieldFor workaround
for timer-event backlog (wxWidgets issue #26192). This replaces them
with a shared DrainPendingEvents free function.
PG_FPID_EDITOR is registered in wxPropertyGrid's global editor
registry and persists across SCH_PROPERTIES_PANEL lifetimes.
UpdateFrame() didn't update the netlist callback lambda.
To fix this, we add an UpdateCallback() to PG_FPID_EDITOR and
call it alongside UpdateFrame() when reusing an existing
editor instance.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23307
Update zone manager to improve usability. Filter zones based on layers,
provide move to top/move to bottom actions, global arrow key navigation,
zoom preservation across zone switches, right-click zoom-to-fit on the
preview canvas, and pixel-aligned icons for top/bottom move buttons.
The matched length diff pair panel had skew data in the constraint class
but no UI field to display or edit it. Added a dedicated overlay panel
with min/opt/max length plus max skew fields, a new bitmap showing a
diff pair with length arrows and skew indicator.
Move onUpdateUI from public to private in EDA_BASE_FRAME since
it is an internal event handler bound via Bind(), not part of
the public API.
Capture the empty-check result before erasing rows in
library_manager.cpp to avoid using invalidated iterators from
the subrange returned by std::ranges::remove_if.
Add null guards to the netHighlightCond toolbar condition
lambda in PCB_EDIT_FRAME to prevent null dereference during
shutdown, matching the pattern used by other toolbar
conditions fixed in f962de966b.
SearchDynamicEventTable does a linear scan through all dynamic
Bind entries for every dispatched event, regardless of event type.
Replace the per-action Bind() calls with a single wxID_ANY handler
that dispatches to the existing m_uiUpdateMap through a hash map.
This reduces the per-event scan from around 150 to about 1 for all
event types. This is particularly noticeable during high frequency
events like mouse drag.
The default constructor of RULE_EDITOR_DATA_BASE left m_isNew
uninitialized. On Linux, the garbage memory value was assigned
causing IsNew() to return true for every rule and appending
astersix to all tree items.
Fix by adding a default member initializer: m_isNew = false.
Clicking on rules in the tree created a wxDragImage each time, which on
macOS opens a hidden full-screen window. These windows were never cleaned
up and piled up as ghost windows in Mission Control.
Removed wxDragImage and replaced drag feedback with a highlight
on the drop target item.
The previous 1 MB limit caused "Maximum line length exceeded" errors
when loading schematics containing large embedded images or other long
quoted tokens. The S-expression parser (DSNLEXER) requires entire
quoted strings to fit within a single line buffer, so Prettify cannot
split them across lines. Raise the limit from 1 MB to 16 MB and add
regression tests.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23162