-
Notifications
You must be signed in to change notification settings - Fork 912
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
Implement CloseRequested
for Web
#3311
Comments
I disagree that Given that, I think this is better solved with a separate top-level event, like |
My motivation here is to make this align more with other platforms:
That sounds like a good solution for the Apologies, I can see how my OP is incomplete now that I read it again. (EDIT: I think I left it out of OP because this is only about the |
I don't think that it should be the case, I'd rather have Also how keyboard input is done? I'd assume it's for the main window, not for the HTML element in particular, but pointer events are likely HTML element aware? Top-level should terminate is a bit questionable given that on web it looks a bit like window, but I don't really mind that. |
There are no subviews in canvases on Web, AFAIK. That's where the idea comes from: just make a canvas be a subview, which would also look like subviews on other platforms.
Every event should be HTML element aware, main window events are
I think I like @madsmtm suggestion so far, that is adding a |
Apologies for hijacking the issue, though by now it's too late, so I'll just respond here anyhow ;)
That's fair, though I think that's more of a documentation issue.
Yeah, I can see this being annoying. A solution could be to allow referencing an element like a
These aren't really doable on most platforms, but I guess you could add
I think I'd expect this to return canvas size + margin? It's not like you can really get the outer dimensions of the browser window anyhow? (Not that I believe this definition of
Hmm, can you expand on this? |
All good, thank you for the input!
Ofc, but how do you actually change the title of the browser window, which is also important and mimics other platforms much closer.
Yes, I was hoping that one day we can expose it regularly at
It is possible, I just don't know how useful it is. See
Haha, yes, just watched you adding that :)
A lot of use-cases involve just having a canvas cover the whole screen, which we don't support very well, we expect users to fix it themselves, like setting CSS Ofc we can fix all of that with platform-specific extensions, but it would be much nicer if we have a cross-platform API that doesn't require so much Web-specific code. The idea here is that |
Yeah, I can see how that makes sense, given that multiple windows aren't supported on Android either, I guess it's somewhat a fools errand to try to make the multiple windows model work. |
This doesn't actually make sense currently, because
Window
on Web should be a view, see #696.After we implement views for Web, and the
Window
actually represents the Web window, we could makeCloseRequested
a special event that if the user doesn't react to withEventLoopWindowTarget::exit()
, we callEvent.preventDefault()
.This is useful to implement a confirmation dialog and the like, similar to what can be done on native by reacting to
CloseRequested
.Firefox currently disables the B/F cache when registering the
beforeunload
event (Bugzilla, so until this addressed we should not implement it or disable it by default).The text was updated successfully, but these errors were encountered: