@@ -17,9 +17,9 @@ use std::time::{Duration, Instant};
17
17
use url:: Url ;
18
18
use winit:: dpi:: { LogicalSize , PhysicalPosition , PhysicalSize , Size } ;
19
19
use winit:: event:: { ElementState , KeyEvent , Modifiers , WindowEvent } ;
20
- use winit:: event_loop:: { ControlFlow , EventLoop , EventLoopBuilder } ;
20
+ use winit:: event_loop:: { ControlFlow , EventLoop } ;
21
21
use winit:: keyboard:: { Key , NamedKey } ;
22
- use winit:: window:: { Fullscreen , Icon , Window , WindowBuilder } ;
22
+ use winit:: window:: { Fullscreen , Icon , Window , WindowAttributes } ;
23
23
24
24
pub struct App {
25
25
preferences : GlobalPreferences ,
@@ -43,22 +43,24 @@ impl App {
43
43
let icon =
44
44
Icon :: from_rgba ( icon_bytes. to_vec ( ) , 32 , 32 ) . context ( "Couldn't load app icon" ) ?;
45
45
46
- let event_loop = EventLoopBuilder :: with_user_event ( ) . build ( ) ?;
46
+ let event_loop = EventLoop :: with_user_event ( ) . build ( ) ?;
47
47
48
48
let no_gui = preferences. cli . no_gui ;
49
49
let min_window_size = ( 16 , if no_gui { 16 } else { MENU_HEIGHT + 16 } ) . into ( ) ;
50
- let max_window_size = get_screen_size ( & event_loop) ;
51
50
let preferred_width = preferences. cli . width ;
52
51
let preferred_height = preferences. cli . height ;
53
52
let start_fullscreen = preferences. cli . fullscreen ;
54
53
55
- let window = WindowBuilder :: new ( )
54
+ let window_attributes = WindowAttributes :: default ( )
56
55
. with_visible ( false )
57
56
. with_title ( "Ruffle" )
58
57
. with_window_icon ( Some ( icon) )
59
- . with_min_inner_size ( min_window_size)
60
- . with_max_inner_size ( max_window_size)
61
- . build ( & event_loop) ?;
58
+ . with_min_inner_size ( min_window_size) ;
59
+
60
+ #[ allow( deprecated) ]
61
+ let window = event_loop. create_window ( window_attributes) ?;
62
+ let max_window_size = get_screen_size ( & window) ;
63
+ window. set_max_inner_size ( Some ( max_window_size) ) ;
62
64
let window = Arc :: new ( window) ;
63
65
64
66
let mut font_database = fontdb:: Database :: default ( ) ;
@@ -136,6 +138,7 @@ impl App {
136
138
// Poll UI events.
137
139
let event_loop = self . event_loop . take ( ) . expect ( "App already running" ) ;
138
140
let event_loop_proxy = event_loop. create_proxy ( ) ;
141
+ #[ allow( deprecated) ]
139
142
event_loop. run ( move |event, elwt| {
140
143
let mut check_redraw = false ;
141
144
match event {
0 commit comments