Skip to content

Pcbnew: Footprint warps to mouse on drag from menu

Description

If you hover over a footprint, then right click and select "Drag" from the context menu, instead of the mouse warping to the footprint center, the footprint warps to the mouse.

The problem appears to be that there is code before the handler invoking the context menu that causes the mouse to warp after the context menu is closed. However, after the menu is closed, there is a specific call to m_viewControls->WarpCursor that moves the mouse that is already in the right position into the wrong position.

I submitted MR !693 (merged) that fixes this issue

Steps to reproduce

  1. Make sure preferences are set to "Warp mouse to origin of moved object"
  2. Hover over footprint
  3. Select footprint
  4. Right click somewhere away from the footprint's center
  5. Use arrow keys to move to "Drag" item
  6. Hit enter key to perform drag
  7. Observe footprint jump to current mouse position instead of mouse moving to center of footprint

Note that step 5 can be done by moving the mouse, but it's just easier to verify it's not inadvertent mouse motion casuing the problem when the footprint leaps to it.

The video below shows this issue in action. Footprint_warps_to_mouse

KiCad Version

Application: KiCad PCB Editor

Version: (5.99.0-9376-g8dcf5404fc), debug build

Libraries:
	wxWidgets 3.1.4
	libcurl/7.71.1-DEV Schannel zlib/1.2.11

Platform: Windows 10 (build 19041), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
	Date: Feb 23 2021 22:35:22
	wxWidgets: 3.1.4 (wchar_t,STL containers)
	Boost: 1.73.0
	Curl: 7.71.1-DEV
	Compiler: Visual C++ 1928 without C++ ABI

Build settings:
	KICAD_SCRIPTING=OFF
	KICAD_SCRIPTING_MODULES=OFF
	KICAD_SCRIPTING_PYTHON3=OFF
	KICAD_SCRIPTING_WXPYTHON=OFF
	KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
	KICAD_SCRIPTING_ACTION_MENU=OFF
	KICAD_SPICE=OFF
	KICAD_STDLIB_DEBUG=OFF
	KICAD_STDLIB_LIGHT_DEBUG=OFF
	KICAD_SANITIZE=OFF
Edited by Peter Montgomery