-
Notifications
You must be signed in to change notification settings - Fork 909
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
AppKit/UIKit: Do not emit default state events upon window creation #3912
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
,CursorMoved
and so on. So let's not do that forScaleFactorChanged
,SurfaceResized
andFocused
either!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.
changelog
module if knowledge of this change could be valuable to users