# gpui: Refresh mouse position after bounds changes \(\#60421\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/961f4f202465629fe00ccf55bd9ebf01d643b931)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 961f4f202465629fe00ccf55bd9ebf01d643b931

Requested commit: 961f4f202465629fe00ccf55bd9ebf01d643b931

Commit: 961f4f202465629fe00ccf55bd9ebf01d643b931

Tree: e97d2bbab4a9f28b6d24f572e1f5b328a365fd6c

Author: 迷渡

Committer: GitHub

## Message

```
gpui: Refresh mouse position after bounds changes (#60421)

## Summary

- Refresh GPUI's cached mouse position when window bounds change so
hover hit-testing uses the current cursor position after live resize.
- Return X11 mouse positions in window-relative logical pixels to keep
`PlatformWindow::mouse_position()` consistent with other backends.

Fixes #57354

## Testing

- `cargo fmt -p gpui -p gpui_linux`
- `cargo check -p gpui_linux`
- `cargo check -p gpui`

## Suggested .rules additions

- In GPUI platform backends, `PlatformWindow::mouse_position()` should
return window-relative logical pixels; use separate APIs or fields for
global/device-pixel coordinates.

Release Notes:

- Fixed incorrect hover state while resizing GPUI windows.
```

## Parents

- [693962917b5a015949ad2e768bc10ea169d41546](https://git.cafe/gitcafe/zed/commit/693962917b5a015949ad2e768bc10ea169d41546?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/961f4f202465629fe00ccf55bd9ebf01d643b931?format=markdown)
