Skip to content

Add a taskbar icon overlay for the editor window to tell if game window is paused or running #106583

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PiCode9560
Copy link
Contributor

Closes godotengine/godot-proposals#12455

This thing work. But I am not sure if it is tidy or efficient.

@PiCode9560 PiCode9560 requested review from a team as code owners May 19, 2025 06:12
@PiCode9560 PiCode9560 force-pushed the taskbar_running_game_indicator branch from 63edf91 to a05f230 Compare May 19, 2025 06:19
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Note: on macOS, default icon is different, this code will work, but a separate version of the icons are needed:

Screenshot 2025-05-19 at 09 50 03

Also, icons probably should be generated from SVG vector graphics, not hardcoded PNGs.

@PiCode9560
Copy link
Contributor Author

icons probably should be generated from SVG vector graphics, not hardcoded PNGs.

Well, the original app_icon is a PNG format. So should I also change that to SVG?

@bruvzg
Copy link
Member

bruvzg commented May 19, 2025

Well, the original app_icon is a PNG format. So should I also change that to SVG?

Original is SVG, PNG is generated from it (it does not mean it should be auto generated on build, it can be done manually when it is changed, but source should be SVG):

https://github.com/godotengine/godot/blob/master/icon.svg

Unfortunately, there's no original SVG for macOS icons (only ICNS).

@PiCode9560
Copy link
Contributor Author

it does not mean it should be auto generated on build, it can be done manually when it is changed, but source should be SVG

Oh ok, so you're saying is I need to use a PNG that is exported manually from SVG, and the SVG is not required to be in the godot files.

@PiCode9560
Copy link
Contributor Author

PiCode9560 commented May 19, 2025

Unfortunately, there's no original SVG for macOS icons (only ICNS).

Unless, whoever made it still have it localy.

@PiCode9560
Copy link
Contributor Author

@bruvzg What am I supposed to do for the macOS icon? I cannot find the code where it chooses a separate icon for the macOS.

@bruvzg
Copy link
Member

bruvzg commented May 19, 2025

There's no code to select the icon, default icons are embedded into app bundle (on macOS) and executable (on Windows).

ifdef can be used in this case:

#ifdef MACOS_ENABLED
 ... set macos icon
#else
 ... set icon for the rest of icons
#endif

@bruvzg
Copy link
Member

bruvzg commented May 19, 2025

macOS icon is here - https://github.com/godotengine/godot/blob/master/misc/dist/macos_tools.app/Contents/Resources/Godot.icns

@bruvzg
Copy link
Member

bruvzg commented May 19, 2025

Same as with the Windows icon, add separate PNGs for macOS.

PNG extracted from ICNS:
Godot

@PiCode9560
Copy link
Contributor Author

For macOS, I need to save the image as PNG and not ICN right?

@bruvzg
Copy link
Member

bruvzg commented May 19, 2025

For macOS, I need to save the image as PNG and not ICN right?

ICNS is for embedding (for OS to see icon when app is not running), set_icon always use normal image. There's also set_native_icon method which take ICNS and ICO, but not sure if there's any reason to use it in this case.

@PiCode9560 PiCode9560 force-pushed the taskbar_running_game_indicator branch 2 times, most recently from 59dcfab to 5a7694a Compare May 19, 2025 11:38
@bruvzg
Copy link
Member

bruvzg commented May 19, 2025

On macOS, it seems to be working fine, will check Windows and Linux later:

Screen.Recording.2025-05-19.at.14.48.10.mov

@Calinou Calinou added this to the 4.x milestone May 19, 2025
@PiCode9560 PiCode9560 force-pushed the taskbar_running_game_indicator branch from 5a7694a to ab2b5b3 Compare May 19, 2025 14:45
@PiCode9560
Copy link
Contributor Author

Moved the status icons to the top right of the icon.

@PiCode9560 PiCode9560 force-pushed the taskbar_running_game_indicator branch from ab2b5b3 to b25e7e8 Compare May 29, 2025 11:20
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.

Add a taskbar icon overlay for the editor window to tell if embedded game window is paused or running
3 participants