Fix mouse behavior in scale_factor_override example#7382
Conversation
|
Bevy shouldn't be messing with the cursor position just because some property of the window was changed. edit: I have an idea of how to fix this properly. I'll probably make a PR soon-ish |
|
The complete fix would be to have different api to update the cursor position from Winit, and to expose to the user. Then add a flag to it, so we know when it comes from the user. This is closer to how it was done before the window as entity PR. I hoped change detection would be enough to avoid the issue, but as it keeps popping up we need to go back to the difference between internal/user demanded updates. |
|
The fix is pretty simple. A clone of the |
|
Even if this is "properly fixed," it's probably not good practice to update the window title every frame. But a proper fix might enable a more elegant solution. I don't personally feel like this example should update the window title anyhow, so I'm just gonna close those. |
Objective
Fixes #7377
Solution
Add an intermediate resource for the override state so that we can update the title only when it has been changed.
Other potential options:
Textinstead, checking to see if the formatted text differs from the current value