Community
Participate
Working Groups
When the context menu is triggered from the keyboard (menu key or SHIFT+F10 on Windows), it should appear as close to the keyboard focus as possible, ignoring the mouse cursor position. It currently pops up at the mouse cursor position. For example, in a text editor, it should pop up by the caret. If the only keyboard focus is the widget itself, it can pop up at the top left of the widget. This is important for accessibility.
Is there anything we can do here?
In order to do this properly, we need to go through every widget in SWT and decide what the selection is (ie. in a tree, it's the focus item while in a text editor, it's the i-beam) and position the menu. This also would need to be done for every platform and for each Custom Widget. The best answer is to provide a "menu resquested event" that has default values for the menu position so that application code can position the menu. For M6, I suggest that we position the menu at 0,0 if the mouse is outside the window, since we don't feel we can get this in for 2.0.
SSQ points out that positioning the menu at 0,0 will obscure the contents of the control when the control is small. Also, if the goal is that the origin of the menu be inside the control, this already doesn't happen when the widget is small and close to the bottom of the screen and the menu is big. NE, can we not fix this PR right now?
Not critical for 2.0. Probably better to leave the current behaviour than position at 0@0. What it means is that someone unable to use the mouse will need to use MouseKeys to position the cursor at the center of the screen. All context menus will then appear there. Thanks for considering it though.
This is a really old bug that we won't be doing anything about.