@@ -749,6 +749,7 @@ impl WindowBuilder for WindowBuilderWrapper {
749749 . decorations ( config. decorations )
750750 . maximized ( config. maximized )
751751 . always_on_top ( config. always_on_top )
752+ . visible_on_all_workspaces ( config. visible_on_all_workspaces )
752753 . content_protected ( config. content_protected )
753754 . skip_taskbar ( config. skip_taskbar )
754755 . theme ( config. theme )
@@ -875,6 +876,13 @@ impl WindowBuilder for WindowBuilderWrapper {
875876 self
876877 }
877878
879+ fn visible_on_all_workspaces ( mut self , visible_on_all_workspaces : bool ) -> Self {
880+ self . inner = self
881+ . inner
882+ . with_visible_on_all_workspaces ( visible_on_all_workspaces) ;
883+ self
884+ }
885+
878886 fn content_protected ( mut self , protected : bool ) -> Self {
879887 self . inner = self . inner . with_content_protection ( protected) ;
880888 self
@@ -1121,6 +1129,7 @@ pub enum WindowMessage {
11211129 SetDecorations ( bool ) ,
11221130 SetShadow ( bool ) ,
11231131 SetAlwaysOnTop ( bool ) ,
1132+ SetVisibleOnAllWorkspaces ( bool ) ,
11241133 SetContentProtected ( bool ) ,
11251134 SetSize ( Size ) ,
11261135 SetMinSize ( Option < Size > ) ,
@@ -1550,6 +1559,16 @@ impl<T: UserEvent> Dispatch<T> for WryDispatcher<T> {
15501559 )
15511560 }
15521561
1562+ fn set_visible_on_all_workspaces ( & self , visible_on_all_workspaces : bool ) -> Result < ( ) > {
1563+ send_user_message (
1564+ & self . context ,
1565+ Message :: Window (
1566+ self . window_id ,
1567+ WindowMessage :: SetVisibleOnAllWorkspaces ( visible_on_all_workspaces) ,
1568+ ) ,
1569+ )
1570+ }
1571+
15531572 fn set_content_protected ( & self , protected : bool ) -> Result < ( ) > {
15541573 send_user_message (
15551574 & self . context ,
@@ -2499,6 +2518,9 @@ fn handle_user_message<T: UserEvent>(
24992518 window. set_has_shadow ( _enable) ;
25002519 }
25012520 WindowMessage :: SetAlwaysOnTop ( always_on_top) => window. set_always_on_top ( always_on_top) ,
2521+ WindowMessage :: SetVisibleOnAllWorkspaces ( visible_on_all_workspaces) => {
2522+ window. set_visible_on_all_workspaces ( visible_on_all_workspaces)
2523+ }
25022524 WindowMessage :: SetContentProtected ( protected) => {
25032525 window. set_content_protection ( protected)
25042526 }
0 commit comments