diff --git a/.changes/outer-position-linux.md b/.changes/outer-position-linux.md index f411e0b3a..e8ea973d4 100644 --- a/.changes/outer-position-linux.md +++ b/.changes/outer-position-linux.md @@ -2,4 +2,4 @@ "tao": "patch" --- -On Linux, `Window::outer_position` and `Window::outer_size` to include border and titlebar. +On Linux, `Window::outer_position`, `Window::outer_size` and `WindowEvent::Moved` to include/account for borders and titlebar. diff --git a/src/platform_impl/linux/event_loop.rs b/src/platform_impl/linux/event_loop.rs index a90f913ba..1d776e550 100644 --- a/src/platform_impl/linux/event_loop.rs +++ b/src/platform_impl/linux/event_loop.rs @@ -579,7 +579,10 @@ impl EventLoop { window.connect_configure_event(move |window, event| { let scale_factor = window.scale_factor(); - let (x, y) = event.position(); + let (x, y) = window + .window() + .map(|w| w.root_origin()) + .unwrap_or_else(|| event.position()); if let Err(e) = tx_clone.send(Event::WindowEvent { window_id: RootWindowId(id), event: WindowEvent::Moved(