Sunshine latest
Self-hosted game stream host for Moonlight.
system_tray Namespace Reference

Handles the system tray icon and notification system. More...

Functions

int end_tray ()
 Exit the system tray.
 
int end_tray_threaded ()
 Stops the threaded system tray and waits for the thread to finish.
 
int init_tray ()
 Initializes the system tray without starting a loop.
 
int init_tray_threaded ()
 Initializes and runs the system tray in a separate thread.
 
int process_tray_events ()
 Processes a single tray event iteration.
 
void tray_donate_github_cb (struct tray_menu *item)
 Callback for opening GitHub Sponsors from the system tray.
 
void tray_donate_patreon_cb (struct tray_menu *item)
 Callback for opening Patreon from the system tray.
 
void tray_donate_paypal_cb (struct tray_menu *item)
 Callback for opening PayPal donation from the system tray.
 
void tray_open_ui_cb (struct tray_menu *item)
 Callback for opening the UI from the system tray.
 
void tray_quit_cb (struct tray_menu *item)
 Callback for exiting Sunshine from the system tray.
 
void tray_reset_display_device_config_cb (struct tray_menu *item)
 Callback for resetting display device configuration.
 
void tray_restart_cb (struct tray_menu *item)
 Callback for restarting Sunshine from the system tray.
 
void update_tray_pausing (std::string app_name)
 Sets the tray icon in pausing mode (stream stopped but app running) and spawns the appropriate notification.
 
void update_tray_playing (std::string app_name)
 Sets the tray icon in playing mode and spawns the appropriate notification.
 
void update_tray_require_pin ()
 Spawns a notification for PIN Pairing. Clicking it opens the PIN Web UI Page.
 
void update_tray_stopped (std::string app_name)
 Sets the tray icon in stopped mode (app and stream stopped) and spawns the appropriate notification.
 

Detailed Description

Handles the system tray icon and notification system.

Function Documentation

◆ end_tray()

int system_tray::end_tray ( )

Exit the system tray.

Returns
0 after exiting the system tray.

◆ end_tray_threaded()

int system_tray::end_tray_threaded ( )

Stops the threaded system tray and waits for the thread to finish.

Returns
0 after stopping the threaded tray.

◆ init_tray()

int system_tray::init_tray ( )

Initializes the system tray without starting a loop.

Returns
0 if initialization was successful, non-zero otherwise.

◆ init_tray_threaded()

int system_tray::init_tray_threaded ( )

Initializes and runs the system tray in a separate thread.

Returns
0 if initialization was successful, non-zero otherwise.

◆ process_tray_events()

int system_tray::process_tray_events ( )

Processes a single tray event iteration.

Returns
0 if processing was successful, non-zero otherwise.

◆ tray_donate_github_cb()

void system_tray::tray_donate_github_cb ( struct tray_menu * item)

Callback for opening GitHub Sponsors from the system tray.

Parameters
itemThe tray menu item.

◆ tray_donate_patreon_cb()

void system_tray::tray_donate_patreon_cb ( struct tray_menu * item)

Callback for opening Patreon from the system tray.

Parameters
itemThe tray menu item.

◆ tray_donate_paypal_cb()

void system_tray::tray_donate_paypal_cb ( struct tray_menu * item)

Callback for opening PayPal donation from the system tray.

Parameters
itemThe tray menu item.

◆ tray_open_ui_cb()

void system_tray::tray_open_ui_cb ( struct tray_menu * item)

Callback for opening the UI from the system tray.

Parameters
itemThe tray menu item.

◆ tray_quit_cb()

void system_tray::tray_quit_cb ( struct tray_menu * item)

Callback for exiting Sunshine from the system tray.

Parameters
itemThe tray menu item.

◆ tray_reset_display_device_config_cb()

void system_tray::tray_reset_display_device_config_cb ( struct tray_menu * item)

Callback for resetting display device configuration.

Parameters
itemThe tray menu item.

◆ tray_restart_cb()

void system_tray::tray_restart_cb ( struct tray_menu * item)

Callback for restarting Sunshine from the system tray.

Parameters
itemThe tray menu item.

◆ update_tray_pausing()

void system_tray::update_tray_pausing ( std::string app_name)

Sets the tray icon in pausing mode (stream stopped but app running) and spawns the appropriate notification.

Parameters
app_nameThe paused application name

◆ update_tray_playing()

void system_tray::update_tray_playing ( std::string app_name)

Sets the tray icon in playing mode and spawns the appropriate notification.

Parameters
app_nameThe started application name

◆ update_tray_stopped()

void system_tray::update_tray_stopped ( std::string app_name)

Sets the tray icon in stopped mode (app and stream stopped) and spawns the appropriate notification.

Parameters
app_nameThe started application name