mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-20 20:22:10 +00:00
Mouse reporting: Fix incorrect position reported for windows with padding
Fixes #6950
This commit is contained in:
parent
858f0c1073
commit
0a2fcf1805
2 changed files with 3 additions and 1 deletions
|
|
@ -73,6 +73,8 @@ Detailed list of changes
|
|||
|
||||
- GNOME Wayland: Fix remembered window size smaller than actual size (:iss:`6946`)
|
||||
|
||||
- Mouse reporting: Fix incorrect position reported for windows with padding (:iss:`6950`)
|
||||
|
||||
|
||||
0.31.0 [2023-11-08]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ cell_for_pos(Window *w, unsigned int *x, unsigned int *y, bool *in_left_half_of_
|
|||
bool in_left_half = true;
|
||||
double mouse_x = global_state.callback_os_window->mouse_x;
|
||||
double mouse_y = global_state.callback_os_window->mouse_y;
|
||||
double left = window_left(w), top = window_top(w), right = window_right(w), bottom = window_bottom(w);
|
||||
double left = g->left, top = g->top, right = g->right, bottom = g->bottom;
|
||||
w->mouse_pos.global_x = mouse_x - left; w->mouse_pos.global_y = mouse_y - top;
|
||||
if (clamp_to_window) {
|
||||
mouse_x = MIN(MAX(mouse_x, left), right);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue