Created
September 9, 2019 01:17
-
-
Save goddessfreya/8f3257384151b4dc898d3a8af27544e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/platform_impl/linux/x11/event_processor.rs b/src/platform_impl/linux/x11/event_processor.rs | |
index d65a0133..7082331b 100644 | |
--- a/src/platform_impl/linux/x11/event_processor.rs | |
+++ b/src/platform_impl/linux/x11/event_processor.rs | |
@@ -545,6 +545,7 @@ impl<T: 'static> EventProcessor<T> { | |
let modifiers = self.window_mod_state.modifiers(); | |
+ eprintln!("[gentz] Key 1"); | |
callback(Event::WindowEvent { | |
window_id, | |
event: WindowEvent::KeyboardInput { | |
@@ -1096,6 +1097,7 @@ impl<T: 'static> EventProcessor<T> { | |
let modifiers = self.device_mod_state.modifiers(); | |
+ eprintln!("[gentz] Key 2"); | |
callback(Event::DeviceEvent { | |
device_id: mkdid(device_id), | |
event: DeviceEvent::Key(KeyboardInput { | |
diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs | |
index 5b283e68..fbcf6612 100644 | |
--- a/src/platform_impl/linux/x11/mod.rs | |
+++ b/src/platform_impl/linux/x11/mod.rs | |
@@ -219,6 +219,7 @@ impl<T: 'static> EventLoop<T> { | |
if evt.readiness.is_readable() { | |
let mut processor = processor.borrow_mut(); | |
let mut pending_events = pending_events.borrow_mut(); | |
+ eprintln!("[gentz] x11 drain"); | |
drain_events(&mut processor, &mut pending_events); | |
} | |
} | |
@@ -265,14 +266,17 @@ impl<T: 'static> EventLoop<T> { | |
loop { | |
// Empty the event buffer | |
{ | |
+ eprintln!("[gentz] ev 1"); | |
let mut guard = self.pending_events.borrow_mut(); | |
for evt in guard.drain(..) { | |
sticky_exit_callback(evt, &self.target, &mut control_flow, &mut callback); | |
} | |
+ eprintln!("[gentz] ev 1 p"); | |
} | |
// Empty the user event buffer | |
{ | |
+ eprintln!("[gentz] ev 2"); | |
let mut guard = self.pending_user_events.borrow_mut(); | |
for evt in guard.drain(..) { | |
sticky_exit_callback( | |
@@ -282,6 +286,7 @@ impl<T: 'static> EventLoop<T> { | |
&mut callback, | |
); | |
} | |
+ eprintln!("[gentz] ev 2 p"); | |
} | |
// Empty the redraw requests | |
{ | |
@@ -314,17 +319,22 @@ impl<T: 'static> EventLoop<T> { | |
ControlFlow::Exit => break, | |
ControlFlow::Poll => { | |
// non-blocking dispatch | |
+ eprintln!("[gentz] ev poll"); | |
self.inner_loop | |
.dispatch(Some(::std::time::Duration::from_millis(0)), &mut ()) | |
.unwrap(); | |
+ eprintln!("[gentz] ev poll 2"); | |
callback( | |
crate::event::Event::NewEvents(crate::event::StartCause::Poll), | |
&self.target, | |
&mut control_flow, | |
); | |
+ eprintln!("[gentz] ev poll 3"); | |
} | |
ControlFlow::Wait => { | |
+ eprintln!("[gentz] ev wait"); | |
self.inner_loop.dispatch(None, &mut ()).unwrap(); | |
+ eprintln!("[gentz] ev wait 2"); | |
callback( | |
crate::event::Event::NewEvents(crate::event::StartCause::WaitCancelled { | |
start: ::std::time::Instant::now(), | |
@@ -333,6 +343,7 @@ impl<T: 'static> EventLoop<T> { | |
&self.target, | |
&mut control_flow, | |
); | |
+ eprintln!("[gentz] ev wait 3"); | |
} | |
ControlFlow::WaitUntil(deadline) => { | |
let start = ::std::time::Instant::now(); | |
@@ -372,6 +383,7 @@ impl<T: 'static> EventLoop<T> { | |
// If the user callback had any interaction with the X server, | |
// it may have received and buffered some user input events. | |
+ eprintln!("[gentz] xserver drain"); | |
self.drain_events(); | |
} | |
@@ -391,10 +403,13 @@ impl<T: 'static> EventLoop<T> { | |
} | |
fn drain_events(&self) { | |
+ eprintln!("[gentz] to drain"); | |
+ | |
let mut processor = self.event_processor.borrow_mut(); | |
let mut pending_events = self.pending_events.borrow_mut(); | |
drain_events(&mut processor, &mut pending_events); | |
+ eprintln!("[gentz] done drain"); | |
} | |
} | |
@@ -403,6 +418,7 @@ fn drain_events<T: 'static>( | |
pending_events: &mut VecDeque<Event<T>>, | |
) { | |
let mut callback = |event| { | |
+ eprintln!("[gentz] Got event "); | |
pending_events.push_back(event); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment