Skip to content
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

IEventCallback API methods #481

Open
deprilula28 opened this issue Mar 20, 2023 · 1 comment
Open

IEventCallback API methods #481

deprilula28 opened this issue Mar 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@deprilula28
Copy link
Contributor

deprilula28 commented Mar 20, 2023

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 deprilula28 added the enhancement New feature or request label Mar 20, 2023
@devshgraphicsprogramming
Copy link
Member

@deprilula28 fill out the table some more

@pollend can you provide us with a row for XCB ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants