File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 windows_subsystem = "windows"
44) ]
55
6+ #[ cfg( target_os = "linux" ) ]
7+ use freya:: winit:: platform:: x11:: {
8+ WindowAttributesExtX11 ,
9+ WindowType ,
10+ } ;
611use freya:: {
712 prelude:: * ,
813 winit:: {
914 dpi:: LogicalPosition ,
10- platform:: x11:: {
11- WindowAttributesExtX11 ,
12- WindowType ,
13- } ,
1415 window:: WindowLevel ,
1516 } ,
1617} ;
@@ -27,22 +28,23 @@ fn main() {
2728 . with_transparency ( true )
2829 . with_background ( Color :: TRANSPARENT )
2930 . with_window_attributes ( move |attributes, el| {
30- let attributes = attributes
31- . with_x11_window_type ( vec ! [ WindowType :: Dock ] )
32- . with_window_level ( WindowLevel :: AlwaysOnTop ) ;
31+ #[ cfg( target_os = "linux" ) ]
32+ let attributes = attributes. with_x11_window_type ( vec ! [ WindowType :: Dock ] ) ;
33+
34+ let mut attributes = attributes. with_window_level ( WindowLevel :: AlwaysOnTop ) ;
3335
3436 if let Some ( monitor) = el
3537 . primary_monitor ( )
3638 . or_else ( || el. available_monitors ( ) . next ( ) )
3739 {
3840 let size = monitor. size ( ) ;
39- attributes. with_position ( LogicalPosition {
41+ attributes = attributes . with_position ( LogicalPosition {
4042 x : size. width as i32 / 2 - width / 2 ,
4143 y : 40 ,
4244 } )
43- } else {
44- attributes
4545 }
46+
47+ attributes
4648 } ) ,
4749 ) ,
4850 )
You can’t perform that action at this time.
0 commit comments