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

Bug Fix: Clicking on a localy focused edit box on a not focused window did open the OSK window #3253

Closed
DorpsGek opened this issue Oct 8, 2009 · 3 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Oct 8, 2009

Zuu opened the ticket and wrote:

This patch fixes a bug found it the last trunk.

How to reproduce (just an example)
* Open the company window
* Click on rename company

The query string window is now focused with the edit box focused.

* Click on the company window

Now the _focused_window is the company window. However each window has its own Window::focused_window member. And the query string window remembers that its edit box had global focus last time the window had focus.

* Click on the query string window

Now the OSK window pops up. Which is the bug since that was not intended with the Widget Focus patch about a year ago, and I have checked with an old trunk version that that was indeed not the case back then.

The attached patch fixes the code to the old behavior. Seeing what have happened and seeing how that person probably though I have added a quite extensive comment. Feel free to crop it if you think it is too extensive.

How the person probably thought:

- hmmmm this variable is set to false in the beginning of the function and now if this if-statement is true the var is set to true. Why not just remove this if-statement and assign the check result to the var.

However that person probably missed that in the case a non focused window gets clicked that variable gets set to true. But the DispatchLeftClickEvent function is not an example of a function which you fully understand by quickly reading it.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3253
@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 8, 2009

Zuu wrote:

I should add that I don't know when this bug was introduced other than that it was later than r14658.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3253#comment6795

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 8, 2009

Zuu wrote:

The patch is against r17741.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3253#comment6797

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r17751


This comment was imported from FlySpray: https://bugs.openttd.org/task/3253

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant