Revert "Propagate error from EventLoop creation" (#3010)

This reverts commit ed26dd58fd.
The patched was merged with a review by accident.
This commit is contained in:
Kirill Chibisov 2023-08-06 06:07:01 +04:00 committed by GitHub
parent ed26dd58fd
commit 793c535b01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 291 additions and 344 deletions

View file

@ -36,7 +36,7 @@ use super::event_loop::sink::EventSink;
use super::output::MonitorHandle;
use super::state::WinitState;
use super::types::xdg_activation::XdgActivationTokenData;
use super::{EventLoopWindowTarget, WaylandError, WindowId};
use super::{EventLoopWindowTarget, WindowId};
pub(crate) mod state;
@ -205,18 +205,18 @@ impl Window {
let event_queue = wayland_source.queue();
// Do a roundtrip.
event_queue.roundtrip(&mut state).map_err(|error| {
os_error!(OsError::WaylandError(Arc::new(WaylandError::Dispatch(
error
))))
event_queue.roundtrip(&mut state).map_err(|_| {
os_error!(OsError::WaylandMisc(
"failed to do initial roundtrip for the window."
))
})?;
// XXX Wait for the initial configure to arrive.
while !window_state.lock().unwrap().is_configured() {
event_queue.blocking_dispatch(&mut state).map_err(|error| {
os_error!(OsError::WaylandError(Arc::new(WaylandError::Dispatch(
error
))))
event_queue.blocking_dispatch(&mut state).map_err(|_| {
os_error!(OsError::WaylandMisc(
"failed to dispatch queue while waiting for initial configure."
))
})?;
}
@ -570,7 +570,9 @@ impl Window {
Ok(())
} else {
let region = Region::new(&*self.compositor).map_err(|_| {
ExternalError::Os(os_error!(OsError::Misc("failed to set input region.")))
ExternalError::Os(os_error!(OsError::WaylandMisc(
"failed to set input region."
)))
})?;
region.add(0, 0, 0, 0);
surface.set_input_region(Some(region.wl_region()));

View file

@ -712,7 +712,7 @@ impl WindowState {
// Positon can be set only for locked cursor.
if self.cursor_grab_mode.current_grab_mode != CursorGrabMode::Locked {
return Err(ExternalError::Os(os_error!(
crate::platform_impl::OsError::Misc(
crate::platform_impl::OsError::WaylandMisc(
"cursor position can be set only for locked cursor."
)
)));