From 2f352ca5cf65c12f3f8e4bba39d41191f0b41767 Mon Sep 17 00:00:00 2001 From: Murarth Date: Sat, 21 Dec 2019 17:47:29 -0700 Subject: [PATCH] X11: Fix CursorEntered event for non-winit window (#1320) * X11: Fix CursorEntered event for non-winit window * Retry CI Co-authored-by: Osspial --- CHANGELOG.md | 1 + src/platform_impl/linux/x11/event_processor.rs | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8be853d..5aa8af25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- On X11, fix `CursorEntered` event being generated for non-winit windows. - On macOS, fix crash when starting maximized without decorations. - On macOS, fix application not to terminate on `run_return`. - On Wayland, fix cursor icon updates on window borders when using CSD. diff --git a/src/platform_impl/linux/x11/event_processor.rs b/src/platform_impl/linux/x11/event_processor.rs index 8c27eefa..9a31a266 100644 --- a/src/platform_impl/linux/x11/event_processor.rs +++ b/src/platform_impl/linux/x11/event_processor.rs @@ -834,14 +834,15 @@ impl EventProcessor { } } } - callback(Event::WindowEvent { - window_id, - event: CursorEntered { device_id }, - }); if let Some(dpi_factor) = self.with_window(xev.event, |window| window.hidpi_factor()) { + callback(Event::WindowEvent { + window_id, + event: CursorEntered { device_id }, + }); + let position = LogicalPosition::from_physical( (xev.event_x as f64, xev.event_y as f64), dpi_factor,