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

RegisterWidget: Fix crash when right-clicking when there is no selected cell #10800

Merged
merged 1 commit into from Jul 2, 2022

Conversation

Pokechu22
Copy link
Contributor

Before, Dolphin would crash if you right-clicked in the blank space on the bottom-right, or if you right-clicked outside of the table without having first clicked on a register. Now, the context menu properly appears, with only "update" listed (I'm not entirely sure what that does, though).

Note that right-clicking outside of the table will use the currently selected register's context menu (instead of the update-only one); this behavior existed beforehand.

I also did a quick check of other uses of customContextMenuRequested, and they all seem to check that a selection exists (or else don't depend on having a selection at all), though I wasn't too deep in this checking (as long as it looked like an if-statement existed, I decided it was probably good).

Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

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

Not entirely sure what the RegisterWidget is/does but looking at the previous code it is pretty obvious how it can crash and this has been fixed. LGTM

@Pokechu22
Copy link
Contributor Author

Select View → Registers (with the debugging UI enabled). RegisterWidget shows the values of the PowerPC registers (well, most of them, at least).

@iwubcode
Copy link
Contributor

iwubcode commented Jul 2, 2022

Confirmed behavior by comparing latest master and this PR. Fixes the crash

@JosJuice JosJuice merged commit 2a79111 into dolphin-emu:master Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants