Skip to content

Commit

Permalink
x11: Windows are Sync again
Browse files Browse the repository at this point in the history
  • Loading branch information
francesca64 committed Apr 19, 2018
1 parent eae7cb2 commit 6ff2b6f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/platform/linux/x11/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ pub struct Window {
pub window: Arc<Window2>,
display: Weak<XConnection>,
windows: Weak<Mutex<HashMap<WindowId, WindowData>>>,
ime_sender: ImeSender,
ime_sender: Mutex<ImeSender>,
}

impl ::std::ops::Deref for Window {
Expand Down Expand Up @@ -1038,7 +1038,7 @@ impl Window {
window: win,
windows: Arc::downgrade(&x_events_loop.windows),
display: Arc::downgrade(&x_events_loop.display),
ime_sender: x_events_loop.ime_sender.clone(),
ime_sender: Mutex::new(x_events_loop.ime_sender.clone()),
})
}

Expand All @@ -1049,7 +1049,10 @@ impl Window {

#[inline]
pub fn send_xim_spot(&self, x: i16, y: i16) {
let _ = self.ime_sender.send((self.window.id().0, x, y));
let _ = self.ime_sender
.lock()
.unwrap()
.send((self.window.id().0, x, y));
}
}

Expand Down

0 comments on commit 6ff2b6f

Please sign in to comment.