Nabla
Nabla copied to clipboard
IEventCallback API methods
Description
Notes about the methods:
- win32:
- in the callback for window movement (`WM_WINDOWPOSCHANGING`), you can change the position and confine movement among other things if you change the `lParam`
https://stackoverflow.com/questions/40258157/modify-the-win32-window-dragging-moving-behavior
- shouldCallDefProc = false (returning false from the event callback)
- WM_CLOSE: causes a crash
- WM_INPUT: causes unresposnsiveness
- for the remaining events, it does nothing; the event still happens as usual
- (for remaining ones i have to go off of google and can't really test)
- mac os x:
- windowWillResize callback allows setting a custom size instead
- windowShouldClose callback allows cancelling the closing of the window
https://developer.apple.com/documentation/appkit/nswindowdelegate
- ios:
- viewWillTransition callback allows using the controller to "animate the transition", but it doesn't look like you can stop the transition from the event callback
https://developer.apple.com/documentation/uikit/uicontentcontainer#//apple_ref/occ/intfm/UIContentContainer
- android
- not much we can do about the rotation it seems
- web
- web apis don't allow you to stop the browser window from being manipulated, and the size of the canvas is controlled by css.
- we can avoid closing the browser window with the "are you sure you want to close the window" dialogue, this is done by calling event.preventDefault() on the web window close event.
Table of platform X event callback:
| onWindowShown | onWindowHidden | onWindowMoved | onWindowResized | onWindowRotated | onWindowMinimized | onWindowMaximized | onWindowClosed | |
|---|---|---|---|---|---|---|---|---|
| Win32 | The API allows for changing the lParam to set the window to any position, allowing for undoing the movement or doing any other change | N/A | Return false crashes | |||||
| Mac OS X | Allows for setting a custom size instead | N/A | Allows cancelling closing of the window | |||||
| Ios | N/A | N/A | N/A | N/A | ||||
| Android | N/A | N/A | N/A | N/A |
Description of the related problem
Solution proposal
Additional context
@deprilula28 fill out the table some more
@pollend can you provide us with a row for XCB ?