-
Enhancement
-
Resolution: Fixed
-
P3
-
fx2.0
On the Mac and some other platforms, the menu comes up on mouse press. On Windows,. Shift+F10 shows a context menu. On the Mac, Ctrl+LeftClick requests a menu while on a a Laptop, Fn+Ctrl+i requests the popup menu.
The right way to do this is to have a menu detect event that abstracts the platform, but if there is no time to make the changes in Glass, we can add the event and implement Windows behavior, then fix it to use the platform later.
Found this code in Fx:
this.addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent event) {
if (event.getButton() != MouseButton.SECONDARY) return;
ContextMenu menu = getSkinnable().getContextMenu();
if (menu == null) return;
menu.show(control, event.getScreenX(), event.getScreenY());
}
});
Justification: Without this event, Fx applications will hard code Windows behavior then need to change when Fx ships for OS X.
The right way to do this is to have a menu detect event that abstracts the platform, but if there is no time to make the changes in Glass, we can add the event and implement Windows behavior, then fix it to use the platform later.
Found this code in Fx:
this.addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent event) {
if (event.getButton() != MouseButton.SECONDARY) return;
ContextMenu menu = getSkinnable().getContextMenu();
if (menu == null) return;
menu.show(control, event.getScreenX(), event.getScreenY());
}
});
Justification: Without this event, Fx applications will hard code Windows behavior then need to change when Fx ships for OS X.
- blocks
-
JDK-8114365 Use platforms context menu detect event to show ContextMenu instead of MouseRelease event.
-
- Closed
-