annotation dialog: "Annotate"-button randomly selects item on schematic

Description

Invoking the "Annotation"-dialog and click on button "Annotate" can select other items on the schematic. It seems the Annotate-button-click is sometimes forwarded to the schematic-canvas and gets there interpreted as additional click.

Happens not always. Mostly the item directly under the "Annotate"-button gets selected (see example - placed a big text at that position to catch the bug/effect). But sometimes also items far away from the Annotate-button-click-position get selected (see picture 3)

Steps to reproduce

  1. open attached project, open root schematic: annotation_dialog.zip
  2. try to zoom/pan the schematic around so that it looks similar to picture 1
  3. Tools-->Annotate to open annotation dialog
  4. click "Annotate"-button: annotation is done (see message), but sometimes also the underlying textbox gets selected - see picture 2

annotation_click_select_02

KiCad Version

Application: KiCad Schematic Editor x64 on x64

Version: (6.99.0-5233-gf2fcd4b8e1), release build

Libraries:
	wxWidgets 3.2.1
	FreeType 2.12.1
	HarfBuzz 5.0.1
	FontConfig 2.14.1

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

	wxWidgets: 3.2.1 (wchar_t,wx containers)
	Boost: 1.80.0
	OCC: 7.6.2
	Curl: 7.86.0-DEV
	ngspice: 38
	Compiler: Visual C++ 1934 without C++ ABI

Build settings:
	KICAD_SPICE=ON
Edited by Maik Freitag