AppKit/UIKit: Do not emit default state events upon window creation#3912
AppKit/UIKit: Do not emit default state events upon window creation#3912
Conversation
| // Like the Windows and macOS backends, we send a `ScaleFactorChanged` and `SurfaceResized` | ||
| // event on window creation if the DPI factor != 1.0 |
There was a problem hiding this comment.
This comment does not seem to be true any more, the code for the Windows backend to do this seems to have been removed.
|
As long as the values are the same as the user queried them at the point of |
88ecc68 to
cd8a062
Compare
|
I have updated since you looked to also remove the redundant |
ScaleFactorChanged upon window creation|
The focus stuff was required before since it wasn't stated whether the window is focused by default or not, so some assumed yeS, others not, so it was a bit messy. I know that right now we explicitly declare that the window is not focused by default. |
|
Ah, nice, thanks! |
In Winit, we generally do not emit events for the initial value of things on the window. Existing examples include
ThemeChanged,ModifiersChanged,Moved,CursorMovedand so on. So let's not do that forScaleFactorChanged,SurfaceResizedandFocusedeither!See also #2696 and #2585 for some of the history on
Focused. I don't know what I was thinking in #2585 (comment), but it's clearly wrong, we don't need to emitFocused(false)since it's the default for all platforms.Part of #2640.
changelogmodule if knowledge of this change could be valuable to users