wayland: Fix drop order for display (#326)

This commit is contained in:
Victor Berger 2017-10-25 18:28:24 +02:00 committed by GitHub
parent 760e588627
commit 58181dbff9
2 changed files with 5 additions and 5 deletions

View file

@ -55,8 +55,6 @@ impl EventsLoopSink {
} }
pub struct EventsLoop { pub struct EventsLoop {
// The wayland display
pub display: Arc<wl_display::WlDisplay>,
// The Event Queue // The Event Queue
pub evq: RefCell<EventQueue>, pub evq: RefCell<EventQueue>,
// our sink, shared with some handlers, buffering the events // our sink, shared with some handlers, buffering the events
@ -70,7 +68,9 @@ pub struct EventsLoop {
// the ctxt // the ctxt
pub ctxt_token: StateToken<StateContext>, pub ctxt_token: StateToken<StateContext>,
// a cleanup switch to prune dead windows // a cleanup switch to prune dead windows
pub cleanup_needed: Arc<Mutex<bool>> pub cleanup_needed: Arc<Mutex<bool>>,
// The wayland display
pub display: Arc<wl_display::WlDisplay>,
} }
// A handle that can be sent across threads and used to wake up the `EventsLoop`. // A handle that can be sent across threads and used to wake up the `EventsLoop`.

View file

@ -12,13 +12,13 @@ use super::wayland_window::{DecoratedSurface, DecoratedSurfaceImplementation};
use super::event_loop::StateContext; use super::event_loop::StateContext;
pub struct Window { pub struct Window {
display: Arc<wl_display::WlDisplay>,
surface: wl_surface::WlSurface, surface: wl_surface::WlSurface,
decorated: Arc<Mutex<DecoratedSurface>>, decorated: Arc<Mutex<DecoratedSurface>>,
monitors: Arc<Mutex<MonitorList>>, monitors: Arc<Mutex<MonitorList>>,
ready: Arc<Mutex<bool>>, ready: Arc<Mutex<bool>>,
size: Arc<Mutex<(u32, u32)>>, size: Arc<Mutex<(u32, u32)>>,
kill_switch: (Arc<Mutex<bool>>, Arc<Mutex<bool>>), kill_switch: (Arc<Mutex<bool>>, Arc<Mutex<bool>>),
display: Arc<wl_display::WlDisplay>,
} }
impl Window { impl Window {
@ -309,4 +309,4 @@ fn surface_impl() -> wl_surface::Implementation<(StateToken<StateContext>, Arc<M
guard.monitors.retain(|m| !Arc::ptr_eq(&m.info, &monitor.info)); guard.monitors.retain(|m| !Arc::ptr_eq(&m.info, &monitor.info));
} }
} }
} }