GUI: fixed wrong clicks from additional mouse buttons (now only left clicks are allowed, closes #11455)

This commit is contained in:
Oleg Agafonov 2023-11-23 09:23:01 +04:00
parent 75958e3710
commit a0ed89035f
17 changed files with 82 additions and 21 deletions

View file

@ -121,6 +121,14 @@ public class MageActionCallback implements ActionCallback {
if (e.isConsumed()) {
return;
}
// allows only a standard mouse buttons
if (!e.isPopupTrigger()
&& !SwingUtilities.isLeftMouseButton(e)
&& !SwingUtilities.isRightMouseButton(e)) {
return;
}
if (data.getComponent().getCardContainer() instanceof CardEventProducer) {
ClientEventType clickType = doubleClick ? ClientEventType.CARD_DOUBLE_CLICK : ClientEventType.CARD_CLICK;
CardEventProducer cardContainer = (CardEventProducer) data.getComponent().getCardContainer();