Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Aug 31, 2022
1 parent 2ccf936 commit ae8b967
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/platform_impl/linux/x11/event_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ impl<T: 'static> EventProcessor<T> {

let position = window.shared_state_lock().position;

let new_outer_position = if moved || position.is_none() {
let new_outer_position = if let (Some(position), false) = (position, moved) {
position
} else {
let mut shared_state_lock = window.shared_state_lock();

// We need to convert client area position to window position.
Expand Down Expand Up @@ -408,8 +410,6 @@ impl<T: 'static> EventProcessor<T> {
});
}
outer
} else {
position.unwrap()
};

if is_synthetic {
Expand Down
4 changes: 4 additions & 0 deletions src/platform_impl/linux/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pub struct UnownedWindow {
screen_id: i32, // never changes
cursor: Mutex<CursorIcon>,
cursor_grabbed_mode: Mutex<CursorGrabMode>,
#[allow(clippy::mutex_atomic)]
cursor_visible: Mutex<bool>,
ime_sender: Mutex<ImeSender>,
pub shared_state: Mutex<SharedState>,
Expand Down Expand Up @@ -269,6 +270,7 @@ impl UnownedWindow {
)
};

#[allow(clippy::mutex_atomic)]
let mut window = UnownedWindow {
xconn: Arc::clone(xconn),
xwindow,
Expand Down Expand Up @@ -1269,6 +1271,7 @@ impl UnownedWindow {
#[inline]
pub fn set_cursor_icon(&self, cursor: CursorIcon) {
let old_cursor = replace(&mut *self.cursor.lock().unwrap(), cursor);
#[allow(clippy::mutex_atomic)]
if cursor != old_cursor && *self.cursor_visible.lock().unwrap() {
self.xconn.set_cursor_icon(self.xwindow, Some(cursor));
}
Expand Down Expand Up @@ -1349,6 +1352,7 @@ impl UnownedWindow {

#[inline]
pub fn set_cursor_visible(&self, visible: bool) {
#[allow(clippy::mutex_atomic)]
let mut visible_lock = self.cursor_visible.lock().unwrap();
if visible == *visible_lock {
return;
Expand Down

0 comments on commit ae8b967

Please sign in to comment.