Fix pointer-to-monitor location code

This commit is contained in:
Brian Tarricone 2022-05-13 19:39:30 -07:00
parent df81c14871
commit e588988254

View File

@ -673,7 +673,12 @@ fn start_unlock_dialog<'a>(conn: &'a xcb::Connection, state: &State<'a>, trigger
window: monitor.root, window: monitor.root,
}); });
let reply = conn.wait_for_reply(cookie)?; let reply = conn.wait_for_reply(cookie)?;
if reply.same_screen() { let px = reply.root_x() as i32;
let py = reply.root_y() as i32;
if reply.same_screen()
&& px >= monitor.x as i32 && px < monitor.x as i32 + monitor.width as i32
&& py >= monitor.y as i32 && py < monitor.y as i32 + monitor.height as i32
{
pointer_monitor = Some(monitor); pointer_monitor = Some(monitor);
break; break;
} }