258 Commits

Author SHA1 Message Date
Jeff Young
74bf678d99 Warp back from context menu before running command.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19560
2025-06-16 10:58:03 +01:00
Marek Roszko
34be0452fd Add some additional breadcrumbs 2025-06-07 09:01:05 -04:00
Jeff Young
60a26308ae COMMIT lifetime safety.
If we pass a COMMIT to a posted action, the COMMIT
may no longer exist when the action is run.
Equally problematic, if another COMMIT is pushed
in between we'd probably also run into trouble.

We still allow the API to do this because we don't
have a better solution at present.  But we need
one.
2025-03-29 21:24:08 +00:00
Wayne Stambaugh
e09b095533 Common folder housekeeping part 3. 2025-01-16 11:50:08 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
JamesJCode
5ff21f9c2d Add ki::any and ki::any_cast for any_casts across translation units
ki::any is a standards-compliant implementation, based on the GCC
standard library. However, it uses type_info::hash_code() to check
the validitiy of a ki:any_cast, rather than comparing the type_info
objects directly. This comparison, used in the standard
implementations, is fragile across translation unit boundaries when
built with Clang.
2024-12-27 17:28:27 +00:00
John Beard
c799966774 Handle pasting of image data from the clipboard
Also move some clipboard functions out of TOOL_MANAGER,
as they had no dependency on that class, and are just free
functions around wxTheClipboard.
2024-10-13 20:47:45 +08:00
Jeff Young
9fcbd4e6d0 Slight reduction in asserts. 2024-07-18 18:01:05 +01:00
dsa-t
34f0fb8f21 Revert "Don't reset the view controls state just because we are setting the already active tool state again"
This reverts commit e914c0c1a073ef9f221ee0cbb3384acefffe5159

(cherry picked from commit 6b7b6fa3e3960aeec405880a47f4c4f2330e872b)

Co-authored-by: Mark Roszko <mark.roszko@gmail.com>
2024-06-04 18:03:41 +00:00
Marek Roszko
132ecee665 Don't reset the view controls state just because we are setting the already active tool state again 2024-05-23 22:23:34 -04:00
jean-pierre charras
e51316a932 Fix a 100% CPU core usage is some editing cases.
In commit 7cb754dd a call to wxMilliSleep(50) was removed (because it created
lag in editing) but this removal created a 100% CPU core usage.
Using a much small sleep time (1ms) fixes these issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17979
2024-05-11 12:53:04 +02:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Jon Evans
f613cd1cb4 ADDED: A new IPC API based on protobuf and nng
Details, documentation, and language bindings are works in
progress and will be evolving over the course of KiCad 9
development.
2024-04-02 19:34:36 -04:00
Jon Evans
299b548a41 Trivial change to avoid crash on tool re-entry
See https://gitlab.com/kicad/code/kicad/-/issues/17164
2024-02-27 19:31:09 -05:00
Jeff Young
0078ccea09 Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17086
2024-02-24 20:06:22 +00:00
Alex Shvartzkop
7cb754ddbb Remove 50ms delay seen in some actions, like duplicating schematic items.
(cherry picked from commit 339646a267df034ca2f53537b5fc13bd3275b43c)
2024-02-24 18:20:16 +03:00
Jeff Young
e68cd04d48 Don't modify reference point if already moving.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16524

(cherry picked from commit 08da9a44940fad77be1316a300e20be06132c742)
2024-02-23 16:53:32 +01:00
Ian McInerney
5a5b7e0064 Stop clearing tool transitions when running tools
There doesn't seem to be a need to actually clear transitions for the
tools when running a handler. This clearing also prevents running
another nested handler from the same tool.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16449
2023-12-29 00:37:38 +00:00
Ian McInerney
b6fffb3923 Add more tool stack tracing 2023-12-29 00:37:38 +00:00
Jeff Young
68cbb820a7 performance efficiencies 2023-12-18 17:20:34 +00:00
Ian McInerney
dd933b7d0e Update CERN copyrights 2023-11-08 21:34:14 +00:00
Alex Shvartzkop
06463fd35a Fixes for Wayland cursor warping:
- Emulate the mouse position, since no motion events are sent after warp
- Do not call wl_surface_commit to prevent an assert
- Re-organize code a bit
2023-09-18 12:56:54 +00:00
Alex Shvartzkop
7b5e725b98 Improve GAL panel refresh logic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15041
2023-07-03 02:15:05 +03:00
Ian McInerney
236de6679c Avoid copying tool parameter in intermediate function call 2023-07-02 22:18:24 +01:00
Jeff Young
773e1a1ab6 Actions with a COMMIT must be run synchronously.
Note that "immediate" doesn't mean quite the same thing: while it will
enter the tool immediately, it won't necessarily finish the tool during
the call if the tool has an event loop.  So for something like Rotate
"immediate" and "synchronous" have the same behaviour, but for something
like Move they do not.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15085
2023-06-30 18:57:37 +01:00
Jon Evans
2ae646136e Prevent crashes on invalid use of tools
See https://gitlab.com/kicad/code/kicad/-/issues/15085
2023-06-29 23:45:22 -04:00
Ian McInerney
2a940a5f70 Add COMMIT to TOOL_EVENTs instead of passing as a parameter 2023-06-27 00:57:59 +01:00
Ian McInerney
b0363023a5 Parameterize the tool manager RunAction function to ensure type stabilty 2023-06-20 21:52:50 +01:00
Ian McInerney
9ebe6e7614 Update tool manager to handle the std::any parameters 2023-06-20 21:52:50 +01:00
Wayne Stambaugh
bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
Marek Roszko
aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Wayne Stambaugh
7361414f4c Fix GCC build issue on Linux. 2023-01-17 07:59:09 -05:00
Marek Roszko
1edf84d756 More wxS ugh 2023-01-17 07:43:04 -05:00
qu1ck
7dfa100ff0 Correctly refresh the board after action plugin run and maintain
selection
2023-01-05 14:05:15 -08:00
Jeff Young
7fe3999457 Fix a bit of fall-out from making command strings non-optional. 2022-09-20 00:08:12 +01:00
Mike Williams
9304607624 TOOL_EVENT: make command string non-optional
We're getting segfaults in places where this isn't checked. Also, add
some asserts so we can catch bad tool push/pop.

Removes all uses of GetCommandStr() and makes it private.
2022-09-19 10:23:09 -04:00
Mike Williams
b7ba24b2d9 TOOL_EVENT: fix lifetime issues with const aEvent& refs
Without this the event is on the stack, and as soon as the tool calls
Wait(), the event will be deallocated. The aEvent reference will then
point to invalid memory.
2022-09-19 07:59:11 -04:00
Seth Hillbrand
b736460e71 Move optional access from value() to *operator
`value()` throws.  Where we check for existence, we don't need to use
the throwing version and should just use the unprotected variant
2022-08-30 13:59:39 -07:00
Seth Hillbrand
f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
Jeff Young
6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01:00
jean-pierre charras
993c446fdf Fix some warnings detected by PVS-STUDIO (most are not used vars) 2022-07-25 18:23:52 +02:00
Seth Hillbrand
db4f2d9dd8 Catch some crashes on shutdown
These can happen when a tool is active that sends signals when exiting
(e.g. deselectEvent).  These may be caught by the active loop in another
tool which might try to update the UI after it has been freed.  By
marking all tools as "shutdown", the only event returned to them should
be null.  As an extra precaution, we flag the shutdown globally within
the tool manager and check this flag before launching either events or
new tools

Fixes https://gitlab.com/kicad/code/kicad/issues/10698
2022-07-15 16:56:01 -07:00
Zoltan Puskas
1c04eb6d0e Fix -Wuninitialized warning in tool manager
Fixes #11866
https://gitlab.com/kicad/code/kicad/-/issues/11866
2022-06-20 22:40:42 +00:00
Jeff Young
f2fc78f380 Don't copy modifiers to prime events.
The modifiers go with the hotkey, not with the action.

Fixes https://gitlab.com/kicad/code/kicad/issues/11618
2022-05-16 13:51:40 +01:00
Jeff Young
d465eb6425 ADDED: automatic zone refilling.
This is for the out-of-box experience for novice users.  It is presumed
that folks with larger more complicated boards will turn it off.

Fixes https://gitlab.com/kicad/code/kicad/issues/6413
2022-02-24 18:16:45 +00:00
Jeff Young
d28714167c All the preferences, all the time.
Fixes https://gitlab.com/kicad/code/kicad/issues/7877

Fixes https://gitlab.com/kicad/code/kicad/issues/5153
2021-12-24 13:08:44 +00:00
Jeff Young
f606679164 Proper numeric sorting for intersheet refs.
Also expunges the horrifically named std::remove and std::remove_if
(neither of which remove anything).
2021-10-01 18:29:21 +01:00
Wayne Stambaugh
bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Ian McInerney
dc27079b71 cleanup tool event and tool action includes 2021-06-06 18:26:26 +01:00
Roberto Fernandez Bautista
ae009e0758 Ensure clipboard data is available after KiCad closes
Always Flush() after SetData()
2021-05-03 19:38:31 +01:00