You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, in the WindowEvent::Resized method, if the calculation result does not meet my requirements or settings. I can cancel the execution of this event by returning false or other methods.
I don't know if this is possible in other backends, but it's not possible in Web.
I don't know about the web platform. What I am currently working with is the window platform. For example, WindowEvent::Resized I mentioned above. EventLoop only provides a notification callback. The reason why the window actually changes is not other than after winit executes the EventLoop callback. Changes to the window are made from winit's code. So the current phenomenon is that no matter what is done in the callback, it is the same as not doing anything. The code in the callback only has the right to know the callback message and has no decision-making power (for example, let winit ignore the message and give up adjusting the window) .
Activity
daxpedda commentedon Jan 2, 2024
I don't know if this is possible in other backends, but it's not possible in Web.
madsmtm commentedon Jan 2, 2024
I think maybe
-[NSWindowDelegate windowwillresize]would be able to provide what you need on macOS, can you confirm that's what you need?(Using that is problematic though, because it works with the outer size of the window, not the inner size).
(And
winitgenerally does not support callbacks (theScaleFactorChangedevent is terrible), so even then, implementing this would be difficult).cyan-river commentedon Jan 3, 2024
I don't know about the web platform. What I am currently working with is the window platform. For example, WindowEvent::Resized I mentioned above. EventLoop only provides a notification callback. The reason why the window actually changes is not other than after winit executes the EventLoop callback. Changes to the window are made from winit's code. So the current phenomenon is that no matter what is done in the callback, it is the same as not doing anything. The code in the callback only has the right to know the callback message and has no decision-making power (for example, let winit ignore the message and give up adjusting the window) .
daxpedda commentedon Jan 3, 2024
It would be good to figure out an API for that first indeed.