-
Notifications
You must be signed in to change notification settings - Fork 44
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
WindowIdentifier::from_native() may only be called once for Wayland GTK windows #20
Comments
Yes that's expected because the handle is unexported when the WindowIdentifier is dropped. I wonder what would be the best way forward here, but addikg a comment at least seems fine to me |
Alright, I’ll submit a PR later today. Another question: To work around this I currently just hold onto the WindowIndentifier in a OnceCell that’s initialised when the window is created. Is that fine or should I always re-request the WindowIdentifier? |
I would say you can keep only once instance around by wrapping it in a OnceCell. I don't know if we can do something about it on the crate side? |
Hm, I don’t really think we can other than hacky ways like having a global HashMap<WeakRef, WindowIdentifier> to remember the WindowIdentifier |
Ah yeah indeed. That would be very painful to do. I guess going with a comment would be good enough for now. Feel free to open another issue regarding the usage of the Default implementation of WindowIdentifier in some of the portals |
Cant we do a static Once that holds the identifier? |
You can, from the application side |
Hello,
it seems like WindowIndentifier::from_native() can only be called once, otherwise the following GCritical is emitted:
This GCritical origins from
gdk_wayland_toplevel_export_handle
. The documentation for that function says:Not sure what would be the best way to handle this, should we just put a notice in the docs?
The text was updated successfully, but these errors were encountered: