@@ -27,7 +27,7 @@ use windows::{
2727 core:: * ,
2828} ;
2929
30- use crate :: * ;
30+ use crate :: { platform :: windows :: WindowsTray , * } ;
3131
3232pub ( crate ) struct WindowsPlatform {
3333 inner : Rc < WindowsPlatformInner > ,
@@ -59,6 +59,7 @@ pub(crate) struct WindowsPlatformState {
5959 callbacks : PlatformCallbacks ,
6060 menus : RefCell < Vec < OwnedMenu > > ,
6161 jump_list : RefCell < JumpList > ,
62+ tray : RefCell < Option < WindowsTray > > ,
6263 // NOTE: standard cursor handles don't need to close.
6364 pub ( crate ) current_cursor : Cell < Option < HCURSOR > > ,
6465 directx_devices : RefCell < Option < DirectXDevices > > ,
@@ -88,6 +89,7 @@ impl WindowsPlatformState {
8889 current_cursor : Cell :: new ( current_cursor) ,
8990 directx_devices : RefCell :: new ( directx_devices) ,
9091 menus : RefCell :: new ( Vec :: new ( ) ) ,
92+ tray : RefCell :: new ( None ) ,
9193 }
9294 }
9395}
@@ -559,6 +561,23 @@ impl Platform for WindowsPlatform {
559561 self . set_dock_menus ( menus) ;
560562 }
561563
564+ fn set_tray ( & self , mut tray : Tray , _menus : Option < Vec < MenuItem > > , _keymap : & Keymap ) {
565+ // let mut actions = Vec::new();
566+ // if let Some(menus) = menus {
567+ // menus.into_iter().for_each(|menu| {
568+ // if let Some(dock_menu) = DockMenuItem::new(menu).log_err() {
569+ // actions.push(dock_menu);
570+ // }
571+ // });
572+ // }
573+ let mut windows_tray = self . inner . state . tray . borrow_mut ( ) ;
574+ if let Some ( windows_tray) = windows_tray. as_mut ( ) {
575+ windows_tray. update ( & tray) ;
576+ } else {
577+ windows_tray. replace ( WindowsTray :: create ( & tray) ) ;
578+ }
579+ }
580+
562581 fn on_app_menu_action ( & self , callback : Box < dyn FnMut ( & dyn Action ) > ) {
563582 self . inner
564583 . state
@@ -1202,7 +1221,7 @@ fn handle_gpu_device_lost(
12021221 Ok ( ( ) )
12031222}
12041223
1205- const PLATFORM_WINDOW_CLASS_NAME : PCWSTR = w ! ( "Zed ::PlatformWindow" ) ;
1224+ const PLATFORM_WINDOW_CLASS_NAME : PCWSTR = w ! ( "GPUI ::PlatformWindow" ) ;
12061225
12071226fn register_platform_window_class ( ) {
12081227 let wc = WNDCLASSW {
0 commit comments