Skip to content

Commit

Permalink
fix Moved event as well
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 30, 2024
1 parent 906b602 commit 81694aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .changes/outer-position-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 4 additions & 1 deletion src/platform_impl/linux/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ impl<T: 'static> EventLoop<T> {
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(
Expand Down

0 comments on commit 81694aa

Please sign in to comment.