Implement From<u64> for WindowId and vise-versa

This should help downstream applications to expose WindowId to the end
users via e.g. IPC to control particular windows in multi window
systems.
This commit is contained in:
Kirill Chibisov 2022-07-02 14:27:19 +03:00 committed by GitHub
parent c55d97183d
commit cb41c58f21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 115 additions and 60 deletions

View file

@ -59,7 +59,7 @@ impl<T: 'static> EventProcessor<T> {
F: Fn(&Arc<UnownedWindow>) -> Ret,
{
let mut deleted = false;
let window_id = WindowId(window_id);
let window_id = WindowId(window_id as u64);
let wt = get_xtarget(&self.target);
let result = wt
.windows
@ -513,7 +513,7 @@ impl<T: 'static> EventProcessor<T> {
// In the event that the window's been destroyed without being dropped first, we
// cleanup again here.
wt.windows.borrow_mut().remove(&WindowId(window));
wt.windows.borrow_mut().remove(&WindowId(window as u64));
// Since all XIM stuff needs to happen from the same thread, we destroy the input
// context here instead of when dropping the window.
@ -1213,11 +1213,7 @@ impl<T: 'static> EventProcessor<T> {
&*window.shared_state.lock(),
);
let window_id = crate::window::WindowId(
crate::platform_impl::platform::WindowId::X(
*window_id,
),
);
let window_id = crate::window::WindowId(*window_id);
let old_inner_size = PhysicalSize::new(width, height);
let mut new_inner_size =
PhysicalSize::new(new_width, new_height);