Bug 559044

Summary: Wrong armListener is called for menuItem when its menu is attached to multiple MenuItems
Product: [Eclipse Project] Platform Reporter: Dieter Mai <maidieter>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: maidieter
Version: 4.15   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
Example Snippet none

Description Dieter Mai CLA 2020-01-10 13:05:02 EST
Created attachment 281448 [details]
Example Snippet

This issue happens on Windows 10 but not on Linux (Ubuntu 18). did not test other OS.
Teste with SWT 12, 14 and 15. All of which had this issue.

How to reproduce
1. Create a Menu with MenuItems A, B and C of the style CASCADE.
2. Create a Menu with with at least one MenuItem.
3. Set the Menu from step 2 as Menu for MenuItem A, B and C.
4. Create an ArmListener for each MenuItem A, B and C.

On Linux: The ArmListener assigned to a MenuItem is called when this MenuItem is armed
On Windows: The ArmListener that was assigned to MenuItem C is called for every MenuItem

Example Code Snippet: see attachment
Comment 1 Dieter Mai CLA 2021-03-24 16:47:05 EDT
Retested with SWT 4.19. The issue still occurs.