Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update winit to 0.27 and glutin to 0.29 #1410

Merged
merged 2 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions glutin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ system = ["iced_winit/system"]
version = "0.4"

[dependencies.glutin]
version = "0.28"
version = "0.29"
git = "https://github.com/iced-rs/glutin"
rev = "7a0ee02782eb2bf059095e0c953c4bb53f1eef0e"
rev = "da8d291486b4c9bec12487a46c119c4b1d386abf"

[dependencies.iced_native]
version = "0.5"
Expand Down
8 changes: 4 additions & 4 deletions glutin/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ where
{
use futures::task;
use futures::Future;
use glutin::event_loop::EventLoop;
use glutin::event_loop::EventLoopBuilder;
use glutin::platform::run_return::EventLoopExtRunReturn;
use glutin::ContextBuilder;

let mut debug = Debug::new();
debug.startup_started();

let mut event_loop = EventLoop::with_user_event();
let mut event_loop = EventLoopBuilder::with_user_event().build();
let proxy = event_loop.create_proxy();

let runtime = {
Expand Down Expand Up @@ -139,10 +139,10 @@ where

let mut context = task::Context::from_waker(task::noop_waker_ref());

event_loop.run_return(move |event, _, control_flow| {
let _ = event_loop.run_return(move |event, _, control_flow| {
use glutin::event_loop::ControlFlow;

if let ControlFlow::Exit = control_flow {
if let ControlFlow::ExitWithCode(_) = control_flow {
return;
}

Expand Down
6 changes: 3 additions & 3 deletions winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ log = "0.4"
thiserror = "1.0"

[dependencies.winit]
version = "0.26"
git = "https://github.com/iced-rs/winit"
rev = "02a12380960cec2f351c09a33d6a7cc2789d96a6"
version = "0.27"
git = "https://github.com/iced-rs/winit.git"
rev = "940457522e9fb9f5dac228b0ecfafe0138b4048c"

[dependencies.iced_native]
version = "0.5"
Expand Down
14 changes: 9 additions & 5 deletions winit/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ where
{
use futures::task;
use futures::Future;
use winit::event_loop::EventLoop;
use winit::event_loop::EventLoopBuilder;

let mut debug = Debug::new();
debug.startup_started();

let event_loop = EventLoop::with_user_event();
let event_loop = EventLoopBuilder::with_user_event().build();
let proxy = event_loop.create_proxy();

let runtime = {
Expand Down Expand Up @@ -186,7 +186,7 @@ where
platform::run(event_loop, move |event, _, control_flow| {
use winit::event_loop::ControlFlow;

if let ControlFlow::Exit = control_flow {
if let ControlFlow::ExitWithCode(_) = control_flow {
return;
}

Expand Down Expand Up @@ -635,7 +635,11 @@ pub fn run_command<A, E>(
));
}
window::Action::FetchMode(tag) => {
let mode = conversion::mode(window.fullscreen());
let mode = if window.is_visible().unwrap_or(true) {
conversion::mode(window.fullscreen())
} else {
window::Mode::Hidden
};

proxy
.send_event(tag(mode))
Expand Down Expand Up @@ -713,7 +717,7 @@ mod platform {
{
use winit::platform::run_return::EventLoopExtRunReturn;

event_loop.run_return(event_handler);
let _ = event_loop.run_return(event_handler);

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion winit/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl Window {
use ::winit::platform::unix::WindowBuilderExtUnix;

if let Some(id) = _id {
window_builder = window_builder.with_app_id(id);
window_builder = window_builder.with_name(id.clone(), id);
}
}

Expand Down
2 changes: 1 addition & 1 deletion winit/src/settings/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PlatformSpecific {
/// Parent window
pub parent: Option<winapi::shared::windef::HWND>,
pub parent: Option<winit::platform::windows::HWND>,

/// Drag and drop support
pub drag_and_drop: bool,
Expand Down