mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 04:40:04 -04:00
x11: Implement run_return using calloop
This commit is contained in:
1010
src/platform_impl/linux/x11/event_processor.rs
Normal file
1010
src/platform_impl/linux/x11/event_processor.rs
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
use std::{cmp, env, mem};
|
use std::{cmp, env, mem};
|
||||||
|
use std::collections::VecDeque;
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::os::raw::*;
|
use std::os::raw::*;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@@ -66,6 +67,7 @@ pub struct UnownedWindow {
|
|||||||
ime_sender: Mutex<ImeSender>,
|
ime_sender: Mutex<ImeSender>,
|
||||||
pub multitouch: bool, // never changes
|
pub multitouch: bool, // never changes
|
||||||
pub shared_state: Mutex<SharedState>,
|
pub shared_state: Mutex<SharedState>,
|
||||||
|
pending_redraws: Arc<::std::sync::Mutex<VecDeque<WindowId>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UnownedWindow {
|
impl UnownedWindow {
|
||||||
@@ -203,6 +205,7 @@ impl UnownedWindow {
|
|||||||
ime_sender: Mutex::new(event_loop.ime_sender.clone()),
|
ime_sender: Mutex::new(event_loop.ime_sender.clone()),
|
||||||
multitouch: window_attrs.multitouch,
|
multitouch: window_attrs.multitouch,
|
||||||
shared_state: SharedState::new(dpi_factor),
|
shared_state: SharedState::new(dpi_factor),
|
||||||
|
pending_redraws: event_loop.pending_redraws.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Title must be set before mapping. Some tiling window managers (i.e. i3) use the window
|
// Title must be set before mapping. Some tiling window managers (i.e. i3) use the window
|
||||||
@@ -1213,6 +1216,6 @@ impl UnownedWindow {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn request_redraw(&self) {
|
pub fn request_redraw(&self) {
|
||||||
unimplemented!();
|
self.pending_redraws.lock().unwrap().push_back(WindowId(self.xwindow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user