@@ -859,6 +859,9 @@ pub struct WindowConfig {
859859 /// Whether the window should always be on top of other windows.
860860 #[ serde( default , alias = "always-on-top" ) ]
861861 pub always_on_top : bool ,
862+ /// Prevents the window contents from being captured by other apps.
863+ #[ serde( default , alias = "content-protected" ) ]
864+ pub content_protected : bool ,
862865 /// If `true`, hides the window icon from the taskbar on Windows and Linux.
863866 #[ serde( default , alias = "skip-taskbar" ) ]
864867 pub skip_taskbar : bool ,
@@ -908,6 +911,7 @@ impl Default for WindowConfig {
908911 visible : default_visible ( ) ,
909912 decorations : default_decorations ( ) ,
910913 always_on_top : false ,
914+ content_protected : false ,
911915 skip_taskbar : false ,
912916 theme : None ,
913917 title_bar_style : Default :: default ( ) ,
@@ -1329,6 +1333,9 @@ pub struct WindowAllowlistConfig {
13291333 /// Allows setting the always_on_top flag of the window.
13301334 #[ serde( default , alias = "set-always-on-top" ) ]
13311335 pub set_always_on_top : bool ,
1336+ /// Allows preventing the window contents from being captured by other apps.
1337+ #[ serde( default , alias = "set-content-protected" ) ]
1338+ pub set_content_protected : bool ,
13321339 /// Allows setting the window size.
13331340 #[ serde( default , alias = "set-size" ) ]
13341341 pub set_size : bool ,
@@ -1394,6 +1401,7 @@ impl Allowlist for WindowAllowlistConfig {
13941401 close : true ,
13951402 set_decorations : true ,
13961403 set_always_on_top : true ,
1404+ set_content_protected : false ,
13971405 set_size : true ,
13981406 set_min_size : true ,
13991407 set_max_size : true ,
@@ -1444,6 +1452,12 @@ impl Allowlist for WindowAllowlistConfig {
14441452 set_always_on_top,
14451453 "window-set-always-on-top"
14461454 ) ;
1455+ check_feature ! (
1456+ self ,
1457+ features,
1458+ set_content_protected,
1459+ "window-set-content-protected"
1460+ ) ;
14471461 check_feature ! ( self , features, set_size, "window-set-size" ) ;
14481462 check_feature ! ( self , features, set_min_size, "window-set-min-size" ) ;
14491463 check_feature ! ( self , features, set_max_size, "window-set-max-size" ) ;
@@ -3040,6 +3054,7 @@ mod build {
30403054 let visible = self . visible ;
30413055 let decorations = self . decorations ;
30423056 let always_on_top = self . always_on_top ;
3057+ let content_protected = self . content_protected ;
30433058 let skip_taskbar = self . skip_taskbar ;
30443059 let theme = opt_lit ( self . theme . as_ref ( ) ) ;
30453060 let title_bar_style = & self . title_bar_style ;
@@ -3072,6 +3087,7 @@ mod build {
30723087 visible,
30733088 decorations,
30743089 always_on_top,
3090+ content_protected,
30753091 skip_taskbar,
30763092 theme,
30773093 title_bar_style,
0 commit comments