File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -161,10 +161,20 @@ impl App {
161
161
if let Some ( _) = self . target . window . winit_window . fullscreen ( ) {
162
162
self . target . window . winit_window . set_fullscreen ( None ) ;
163
163
} else {
164
- self . target
165
- . window
166
- . winit_window
167
- . set_fullscreen ( Some ( winit:: window:: Fullscreen :: Borderless ( None ) ) ) ;
164
+ let monitor = self . target . window . winit_window . current_monitor ( ) ;
165
+ let f = if let Some ( monitor) = monitor {
166
+ let mut modes = monitor. video_modes ( ) ;
167
+ if let Some ( m) = modes. next ( ) {
168
+ log:: info!( "Video #{}: {}" , 0 , m) ;
169
+ winit:: window:: Fullscreen :: Exclusive ( m)
170
+ } else {
171
+ winit:: window:: Fullscreen :: Borderless ( None )
172
+ }
173
+ } else {
174
+ winit:: window:: Fullscreen :: Borderless ( None )
175
+ } ;
176
+
177
+ self . target . window . winit_window . set_fullscreen ( Some ( f) ) ;
168
178
}
169
179
}
170
180
WindowEvent :: CloseRequested => * control_flow = ControlFlow :: Exit ,
You can’t perform that action at this time.
0 commit comments