Create account / Log in

Weird (inconsistent) action button behaviour

Issues with the Vassal engine.

Moderators: uckelman, Tim M

Weird (inconsistent) action button behaviour

Postby Benkyo » March 18th, 2015, 12:39 pm

I have these action buttons set up, and they work fine. Click, lots of stuff happens, very convenient.

One day I noticed that I could add a Trigger Action with a menu command, which performed slightly different Keystrokes to the Trigger Action triggered by the Action Button, so a user could right-click the action button and select a menu command for a different result than a left-click.

Multi-function action buttons, awesome!

I made three such buttons, which are functionally identical, with the same traits in the same orders, with only a different Global Key Command trait and a different Report Action text in each button. All the rest is tied to the same Prototype, which is where the right-click Trigger Actions also are.

Here's the weird bit:
Two of the buttons work "as intended". You can left-click on them for a (non-menu) Trigger Action or right-click on them for different (menu) Trigger Actions.
One of the buttons works differently. If you right-click on it the non-menu Trigger Action triggers, then the right-click menu Trigger Actions appear, and clicking on them works as expected.

How is this possible? Which of the two results is a bug, and which is how the Vassal devs would expect things to happen?

Thanks for reading!
Benkyo
 
Posts: 243
Joined: March 13th, 2013, 11:02 pm

Re: Weird (inconsistent) action button behaviour

Postby Tim M » March 18th, 2015, 2:40 pm

I expect how the first two buttons work to be the intended behavior. It sounds like something is getting crossed in the third button with its action button/trigger action command keys..
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Weird (inconsistent) action button behaviour

Postby Benkyo » March 18th, 2015, 10:27 pm

I think I have found the cause. This is going to sound crazy but I have tested it extensively:

When the right-click menu can be displayed entirely within the Vassal window, the right-click works as intended.
When the right-click menu is partially displayed outside the Vassal window (the menu is long, or the button is very close to the window edge), the left-click trigger triggers and then the right-click menu appears.

This can be tested with any button by expanding/shrinking the window, and the same button will behave differently depending on the above conditions.

Definitely a bug.
Benkyo
 
Posts: 243
Joined: March 13th, 2013, 11:02 pm

Re: Weird (inconsistent) action button behaviour

Postby uckelman » March 18th, 2015, 10:35 pm

Thus spake Benkyo:
> I think I have found the cause. This is going to sound crazy but I have
> tested it extensively:

It's not crazy. Java Swing draws context menus which fall entirely
within Swing windows itself, but relies on the window manager to draw
ones which fall at least partly outside of Swing windows.

I _believe_ the explanation for what you're seeing is that unfortunately
this causes the window focus to differ in these two cases. We don't
control that, so it's _probably_ a bug in Java.

If you'd like me to investigate further, provide a test module.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8792
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Weird (inconsistent) action button behaviour

Postby Benkyo » March 19th, 2015, 12:31 pm

Here you go:
https://www.dropbox.com/s/di1j9vt50fyee ... .vmod?dl=0

A 100x100 board, and two identical buttons with slightly different positions, a report triggered by the action button and 5 other reports triggered by right-click trigger menu options.
Benkyo
 
Posts: 243
Joined: March 13th, 2013, 11:02 pm


Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 2 guests