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

PR: Fix segfault on shortcut preferences when using mouse #6092

Merged
merged 1 commit into from
Dec 30, 2017

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Dec 29, 2017

Fixes #5426.

To recreate the issue (at least on Ubuntu):

  • Open Preferences and click on Keyboard Shortcuts.
  • Select a shortcut to edit, either by using Enter on the keyboard or by double clicking the line (meaning that mouse vs. keyboard isn't important at this step).
  • Without this change, if you immediately click Cancel, the seg fault occurs.
  • However, if instead of clicking, you use the keyboard 'Tab' to highlight cancel (as the text in the dialog suggests to do to switch focus), then you can press Enter on the Cancel button and not get the seg fault.
  • The same thing happens with the OK button.

This seemed to be a difference between keyboard entry and mouse clicking on the buttons. In the code, the only difference was setting widget focus, so by adding focus to the mouse click, it prevents the seg fault.

I don't know the underlying cause, so this may be a hack in order to fix it, but it does work.

@ccordoba12 ccordoba12 added this to the v3.2.6 milestone Dec 30, 2017
@ccordoba12
Copy link
Member

Thanks a lot for this @csabella! Could you move this PR to 3.x since you said this bug is also present there? Thanks!

@csabella csabella changed the base branch from master to 3.x December 30, 2017 11:01
@csabella
Copy link
Contributor Author

I had done it under 3.x, but forgot to change it when creating the PR. Thanks for catching it and sorry about that!

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Really good to have a fix for this one! Thanks Cheryl!

@ccordoba12 ccordoba12 changed the title PR: Seg fault on shortcut preferences when using mouse PR: Fix segfault on shortcut preferences when using mouse Dec 30, 2017
@ccordoba12 ccordoba12 merged commit b8c0b78 into spyder-ide:3.x Dec 30, 2017
ccordoba12 added a commit that referenced this pull request Dec 30, 2017
@csabella csabella deleted the issue5426 branch December 30, 2017 16:28
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.

2 participants