@@ -443,7 +443,7 @@ impl WrapperSpace for PanelSpace {
443443 let config_name = self . config . name . clone ( ) ;
444444 let env_vars = vec ! [
445445 ( "COSMIC_PANEL_NAME" . to_string( ) , config_name) ,
446- ( "COSMIC_PANEL_OUTPUT" . to_string( ) , active_output) ,
446+ ( "COSMIC_PANEL_OUTPUT" . to_string( ) , active_output. clone ( ) ) ,
447447 ( "COSMIC_PANEL_SPACING" . to_string( ) , config_spacing) ,
448448 ( "COSMIC_PANEL_ANCHOR" . to_string( ) , config_anchor) ,
449449 ( "COSMIC_PANEL_BACKGROUND" . to_string( ) , config_bg) ,
@@ -623,6 +623,7 @@ impl WrapperSpace for PanelSpace {
623623 trace ! ( "child: {}, {:?} {:?}" , & exec, args, applet_env) ;
624624
625625 info ! ( "Starting: {}" , exec) ;
626+ let active_output = active_output. clone ( ) ;
626627
627628 let mut process = Process :: new ( )
628629 . with_executable ( & exec)
@@ -672,11 +673,18 @@ impl WrapperSpace for PanelSpace {
672673 let security_context = if requests_wayland_display && should_restart {
673674 security_context_manager_clone. as_ref ( ) . and_then (
674675 |security_context_manager| {
676+ let active_output = active_output. clone ( ) ;
677+
675678 security_context_manager
676679 . create_listener :: < SpaceContainer > ( & qh_clone)
677680 . ok ( )
678681 . inspect ( |security_context| {
679682 security_context. set_sandbox_engine ( NAME . to_string ( ) ) ;
683+ security_context. set_app_id ( id_clone. clone ( ) ) ;
684+ security_context. set_instance_id ( format ! (
685+ "{}.{}" ,
686+ id_clone, active_output
687+ ) ) ;
680688 security_context. commit ( ) ;
681689
682690 let data =
0 commit comments