-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
TrayBroker class for interaction with desktop services #60501
base: master
Are you sure you want to change the base?
Conversation
3e00754
to
97f261d
Compare
Your pr has been approve for cicd testing. I'll see if I can get some time and ask if others would be interested in reviewing this. @RandomShaper and others. |
97f261d
to
aaf122b
Compare
aaf122b
to
601678c
Compare
601678c
to
a1e39e9
Compare
We discussed this pull request in this week's proposal review meeting. We ended up agreeing that exposing a generic TrayBroker files may not be useful in most projects, and that only higher-level functionality (such as native file dialogs) should be made available to the user instead. Either way, exposing native file dialogs as-is may also be problematic when specific permissions are required to read/write files (e.g. when macOS sandbox mode is enabled). Instead, it may be better to focus on adding an API to request generic permissions from the OS first. Feel free to open a proposal for that 🙂 |
Then how about |
Both native file picker dialogs (godotengine/godot-proposals#1123) and notifications (godotengine/godot-proposals#1338) need to communicate with the desktop so they can be used inside the engine.
I found that doing the interaction in
OS
might be cumbersome so instead this PR proposes a new singleton tasked with doing communications with the desktop through the native methods (e.g. DBus for LinuxBSD and WinAPI for Windows platforms).It is essentially a broker end for engine classes (hence the name
TrayBroker
) so these use an unified and reusable interface.This was tested via implementing a
Notification
class and sending notifications from GDScript.The LinuxBSD version of
TrayBroker
requires anOptional
class for uninitialized values in the event poller.