Use GAL_DRAWING_CONTEXT as this unlocks the context in its destructor,
so that when an exception is thrown inside the `try` block, it should
automatically unlock before we switch backend.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10840
Starting in be8327bd54, we assume that all
exceptions in DoRePaint() are caused by OpenGL. But many calls in
UpdateItems() will throw if there are internal errors such as
std::out_of_range. Here, we catch those errors and simply skip ahead
rather than falling back to Cairo
(cherry picked from commit 444801ada6)
On MSW, CaptureMouse() was sometimes called event if the GAL panel has
captured the mouse (that was not accepted by wxMSW), although HasCapture()
returns false.
(Perhaps some race condition between events)
The fix add a flag to avoid calling twice CaptureMouse() after only one
wxEVT_MOUSE_CAPTURE_LOST event was received.
Fixes#8239https://gitlab.com/kicad/code/kicad/issues/8239
The native cursor must be set on the GAL canvas wx object,
not its frame (otherwise on GTK the cursor is only set
when we get a request for it from the WM and not immediately).
Fixes https://gitlab.com/kicad/code/kicad/issues/6421
Before, it was possible for the canvas to steal the
focus if the cursor was only moved over it and not
clicked. Now, the canvas will only take the focus if
the frame is active.
Fixes https://gitlab.com/kicad/code/kicad/issues/7233
After commit 9535153f9e there were no more IDs inside the legacy ID
system. Therefore the entire system for dispatching and looking up
the legacy ideas and handling those events can now be removed and
the tool dispatcher simplified (it no longer needs to know about
the ACTIONS class).
Vertex memory allocation uses malloc and realloc without checking the
result. Throw exceptions that can be caught in the DoRepaint() method
in EDA_DRAW_PANEL_GAL when malloc and realloc return a null pointer.
So the new steals-focus protection stuff works well when there's a
focused control, but not as well when there's a modal dialog up which
happens not to have a focused control (or worse, a focusable control).
This adds a second mechanism for also checking to see if a modal dialog
is up (something that wxWidgets, true to form, makes very difficult).
Fixes https://gitlab.com/kicad/code/kicad/issues/6520
The infobar changes the size of the visible screen, so adding/removing
it will shift the screen center, causing the position of onscreen
objects to move up/down. This changes the sizing to pin the bottom
corner position when showing/hiding the infobar
Fixes https://gitlab.com/kicad/code/kicad/issues/5776
For instance, we get things like high-contrast-mode from the pad
dialog when rendering a pad preview, but we want the colours from the
parent PCB_BASE_FRAME.
On platforms with limited framebuffer attachments, like GC7000L
driven by the open source etnaviv driver, we can still use
GPU acceleration by drawing directly to the main buffer.
EDA_DRAW_PANEL_GAL::onPaint checks if an overlay target is
available in the GAL, and if not, redraws the whole view if the
overlay target should be dirty.
Clearing of the overlay target is a no-op if there is no overlay
buffer.
Signed-off-by: Lukas F. Hartmann <lukas@mntre.com>
- New public static function OPENGL_GAL::CheckFeatures() gets called in EDA_DRAW_PANEL_GAL::SwitchBackend() before switching to OPENGL_GAL
- Moved all OpenGL feature checks from OPENGL_GAL constructor to OPENGL_GAL::init()
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4714
The canvas size is not guaranteed to be strictly > 0, so we need to
enforce a minimum returned size before dividing by it or passing to GAL
initialization
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme
Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
The thumb size changes between system versions and (on GTK) render
managers, so hard-coded wasn't working. This gets the actual value from
the system and uses to adjust the range. Changes in the range can also
trigger the refresh.
Fixes: lp:1822617
* https://bugs.launchpad.net/kicad/+bug/1822617
Fixes: lp:1816749
* https://bugs.launchpad.net/kicad/+bug/1816749