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

Implement support for application status indicators (tray icons). #80211

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Aug 3, 2023

Partially implements godotengine/godot-proposals#2349

Adds support for tray icons and handling click events on it.

  • Windows
  • macOS
  • Linux (org.freedesktop.StatusNotifierItem/org.kde.StatusNotifierItem on D-BUS) Interface seems to be tied to specific GUI kit menus and external icon resources, so will keep it Windows/macOS only for now.

@Calinou
Copy link
Member

Calinou commented Aug 3, 2023

Great work 🙂

I suppose this will need the ability to define native menus for the tray, similar to the global menu implementation on macOS. Supporting a list of options to choose from is probably sufficient for an initial implementation.

Adds support for tray icons and handling click events on it.

Could separate middle/right-click/mouse wheel actions be supported on tray icons? I believe this is only possible on Windows and Linux though.

For instance, some music players allow middle-clicking their tray icon to play/pause the current track (or using the mouse wheel on the tray icon to change volume).

@scgm0
Copy link
Contributor

scgm0 commented Sep 8, 2023

Is this pr still going on?

@bruvzg
Copy link
Member Author

bruvzg commented Sep 29, 2023

I suppose this will need the ability to define native menus for the tray, similar to the global menu implementation on macOS. Supporting a list of options to choose from is probably sufficient for an initial implementation.

Currently, it's only detecting clicks, and passing display coordinates to the callback function, which can be used to show Godot menu (if window embedding is disabled) or any other window. But I guess native menu support might be necessary (at least for Linux implementation), but probably as a separate PR, since it might be useful for context menus in general.

Could separate middle/right-click/mouse wheel actions be supported on tray icons? I believe this is only possible on Windows and Linux though.

It is detecting left/middle/right (but not scroll wheel or other buttons), button index is passed to the same callback.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Sounds like a nice feature to have for non-game apps, or specific game needs.

doc/classes/DisplayServer.xml Outdated Show resolved Hide resolved
doc/classes/DisplayServer.xml Outdated Show resolved Hide resolved
doc/classes/StatusIndicator.xml Outdated Show resolved Hide resolved
platform/macos/godot_status_item.h Outdated Show resolved Hide resolved
doc/classes/StatusIndicator.xml Show resolved Hide resolved
@akien-mga akien-mga merged commit 7069b3d into godotengine:master Feb 13, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants