diff --git a/examples/open_window.rs b/examples/open_window.rs index 2082716..8e50c61 100644 --- a/examples/open_window.rs +++ b/examples/open_window.rs @@ -24,6 +24,7 @@ impl baseview::Receiver for MyProgram { fn on_message(&mut self, message: Message) { match message { + Message::RenderExpose => {} Message::CursorMotion(x, y) => { println!("Cursor moved, x: {}, y: {}", x, y); } @@ -57,9 +58,6 @@ impl baseview::Receiver for MyProgram { Message::WindowUnfocus => { println!("Window unfocused"); } - Message::Opened(window_info) => { - println!("Window opened, {:?}", window_info); - } Message::WillClose => { println!("Window will close"); } diff --git a/src/message.rs b/src/message.rs index 0d660db..16f3b9c 100644 --- a/src/message.rs +++ b/src/message.rs @@ -38,6 +38,7 @@ pub struct WindowInfo { #[derive(Debug)] pub enum Message { + RenderExpose, CursorMotion(i32, i32), // new (x, y) relative to window MouseDown(MouseButtonID), MouseUp(MouseButtonID), @@ -49,6 +50,5 @@ pub enum Message { WindowResized(WindowInfo), // new (width, height) WindowFocus, WindowUnfocus, - Opened(WindowInfo), WillClose, } diff --git a/src/x11/window.rs b/src/x11/window.rs index e165e96..5aec0af 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -179,8 +179,7 @@ impl Window { match event_type { xcb::EXPOSE => { - #[cfg(all(feature = "gl_renderer", not(feature = "wgpu_renderer")))] - opengl_util::xcb_expose(window_id, raw_display, self.ctx); + self.receiver.on_message(Message::RenderExpose); } xcb::MOTION_NOTIFY => { let event = unsafe { xcb::cast_event::(&event) };