Fixes https://gitlab.com/kicad/code/kicad/issues/5943
Fixes: lp:1102168 * https://bugs.launchpad.net/kicad/+bug/1102168 Fixes: lp:1779913 * https://bugs.launchpad.net/kicad/+bug/1779913 (cherry picked from commit 83781ab)