Files
komorebi/komorebi-windows/src/process_movement.rs
T
LGUG2Z cd3892de76 refactor(repo): move the platform libraries to their final directories (pure move)
komorebi/                          -> komorebi-windows/
komorebi-for-kde/komorebi/         -> komorebi-linux/
komorebi-for-mac/komorebi/         -> komorebi-macos/
komorebi-for-kde/komorebi-hotkeys/ -> komorebi-hotkeys/

The directories now carry the names of their packages (komorebi-windows, komorebi-linux,
komorebi-macos). Renames only: every file is a 100% rename (270 files); nothing is edited,
so the workspace does not build at this revision. The next revision fixes the paths.
2026-11-05 15:03:27 -08:00

43 lines
1.4 KiB
Rust

use std::sync::Arc;
use parking_lot::Mutex;
use winput::Action;
use winput::message_loop;
use winput::message_loop::Event;
use crate::core::FocusFollowsMouseImplementation;
use crate::window_manager::WindowManager;
#[tracing::instrument]
pub fn listen_for_movements(wm: Arc<Mutex<WindowManager>>) {
std::thread::spawn(move || {
let mut ignore_movement = false;
let receiver = message_loop::start().expect("could not start winput message loop");
loop {
let focus_follows_mouse = wm.lock().focus_follows_mouse;
if matches!(
focus_follows_mouse,
Some(FocusFollowsMouseImplementation::Komorebi)
) {
match receiver.next_event() {
// Don't want to send any raise events while we are dragging or resizing
Event::MouseButton { action, .. } => match action {
Action::Press => ignore_movement = true,
Action::Release => ignore_movement = false,
},
Event::MouseMoveRelative { .. } if !ignore_movement => {
match wm.lock().raise_window_at_cursor_pos() {
Ok(()) => {}
Err(error) => tracing::error!("{}", error),
}
}
_ => {}
}
}
}
});
}