Skip to content
Open
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
1 change: 1 addition & 0 deletions frontends/rioterm/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
self.titles.set_key_val(i, content, None);
}
}
//println!("MITIGATION");

self.titles.set_key(id);
}
Expand Down
4 changes: 1 addition & 3 deletions rio-window/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ pub trait ApplicationHandler<T: 'static = ()> {
/// Emitted when an event is sent from [`EventLoopProxy::send_event`].
///
/// [`EventLoopProxy::send_event`]: crate::event_loop::EventLoopProxy::send_event
fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T) {
let _ = (event_loop, event);
}
fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T);

/// Emitted when the OS sends an event to a winit window.
fn window_event(
Expand Down
11 changes: 7 additions & 4 deletions rio-window/src/platform_impl/linux/wayland/event_loop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct EventLoop<T: 'static> {

/// The Wayland dispatcher to has raw access to the queue when needed, such as
/// when creating a new window.
wayland_dispatcher: WaylandDispatcher,
wayland_dispatcher: Rc<WaylandDispatcher>,

/// Connection to the wayland server.
connection: Connection,
Expand Down Expand Up @@ -123,13 +123,16 @@ impl<T: 'static> EventLoop<T> {
},
);

// register_dispatcher requires ownership of the dispatcher.
map_err!(
event_loop
.handle()
.register_dispatcher(wayland_dispatcher.clone()),
WaylandError::Calloop
)?;

let dispatch_clone = Rc::new(wayland_dispatcher);

// Setup the user proxy.
let pending_user_events = Rc::new(RefCell::new(Vec::new()));
let pending_user_events_clone = pending_user_events.clone();
Expand Down Expand Up @@ -169,7 +172,7 @@ impl<T: 'static> EventLoop<T> {

let window_target = ActiveEventLoop {
connection: connection.clone(),
wayland_dispatcher: wayland_dispatcher.clone(),
wayland_dispatcher: Rc::clone(&dispatch_clone),
event_loop_awakener,
queue_handle,
control_flow: Cell::new(ControlFlow::default()),
Expand All @@ -183,7 +186,7 @@ impl<T: 'static> EventLoop<T> {
buffer_sink: EventSink::default(),
window_ids: Vec::new(),
connection,
wayland_dispatcher,
wayland_dispatcher: Rc::clone(&dispatch_clone),
user_events_sender,
pending_user_events,
event_loop,
Expand Down Expand Up @@ -685,7 +688,7 @@ pub struct ActiveEventLoop {
pub state: RefCell<WinitState>,

/// Dispatcher of Wayland events.
pub wayland_dispatcher: WaylandDispatcher,
pub wayland_dispatcher: Rc<WaylandDispatcher>,

/// Connection to the wayland server.
pub connection: Connection,
Expand Down
Loading