Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoids crashing when selected_action is null #586

Merged
merged 2 commits into from
Apr 30, 2022
Merged

Conversation

BHSDuncan
Copy link
Collaborator

No description provided.

@balloonpopper
Copy link
Collaborator

Copy link
Collaborator

@balloonpopper balloonpopper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this as it fixes the bug and stops Escoria crashing (yay!)

@BHSDuncan as the left click works as expected if you click in the window when a different application is active, is it possible to make right click work correctly? My expected behavior would be that either neither button works (clicking either button on the window just makes it the active window), or clicking back on the window does the correct action for the left and right buttons respectively.
If it is possible, do you want to handle that as an enhancement for 4.1?

@BHSDuncan
Copy link
Collaborator Author

I'm approving this as it fixes the bug and stops Escoria crashing (yay!)

@BHSDuncan as the left click works as expected if you click in the window when a different application is active, is it possible to make right click work correctly? My expected behavior would be that either neither button works (clicking either button on the window just makes it the active window), or clicking back on the window does the correct action for the left and right buttons respectively. If it is possible, do you want to handle that as an enhancement for 4.1?

I'm not sure, to be honest. The difference is that right-clicking on an item requires a current action of some kind to already be present, and I can't remember how right-click works normally in terms of an action not already being selected (since it obviously doesn't crash there). I'm sure there's a straight-forward answer, but let's get @StraToN to weigh in.

@StraToN
Copy link
Collaborator

StraToN commented Apr 25, 2022

I am not certain to understand the issue here as I am unable to reproduce it under Linux. I guess it's a specificity of Windows, maybe, but for now I don't get the exact problem.

9-verbs UI is supposed to mimic LucasArts' 9-verb UI (mostly): each element of the room has a default action defined (ESCItem.default_action), right-click is supposed to execute that action on the focused item.

Does the crash only happen on ESCItems that have no defined default_action ?

@balloonpopper
Copy link
Collaborator

balloonpopper commented Apr 26, 2022

It happens on items that have a default action. Maybe this picture explains it better @StraToN ?
With the calculator as the active application window, I right click the picture (which should cause the look action to run but doesn't).
image

@StraToN
Copy link
Collaborator

StraToN commented Apr 30, 2022

On a side note: this issue does not happen on Linux.
This is because of the OS window manager.

Windows won't sent any mouse input event to a window that not the active one.
Linux will.

@StraToN StraToN merged commit f9e39af into develop Apr 30, 2022
@StraToN StraToN deleted the issue-247 branch July 11, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants