diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-30 15:53:20 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-30 16:46:57 +0300 |
commit | 6bd2c6789b244a03bccdb254502567691c42b944 (patch) | |
tree | 264949e98f2d99a91e9a393c0cd3478ef1701a77 /source/blender/windowmanager/wm_window.h | |
parent | df40e9d0aad0c2a5b649d99c25e991a3664501c5 (diff) |
GHOST: get/set cursor position now uses client instead of screen coords
Use client (window) relative coordinates for cursor position access,
this only moves the conversion from window-manager into GHOST,
(no functional changes).
This is needed for fix a bug in GHOST/Wayland which doesn't support
accessing absolute cursor coordinates & the window is needed to properly
access the cursor coordinates.
As it happens every caller to GHOST_GetCursorPosition was already making
the values window-relative, so there is little benefit in attempting to
workaround the problem on the Wayland side.
If needed the screen-space versions of functions can be exposed again.
Diffstat (limited to 'source/blender/windowmanager/wm_window.h')
-rw-r--r-- | source/blender/windowmanager/wm_window.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index 67557768413..3644aa085f7 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -100,8 +100,11 @@ void wm_window_set_swap_interval(wmWindow *win, int interval); bool wm_window_get_swap_interval(wmWindow *win, int *intervalOut); void wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y); -void wm_cursor_position_from_ghost(wmWindow *win, int *r_x, int *r_y); -void wm_cursor_position_to_ghost(wmWindow *win, int *x, int *y); +void wm_cursor_position_from_ghost_screen_coords(wmWindow *win, int *r_x, int *r_y); +void wm_cursor_position_to_ghost_screen_coords(wmWindow *win, int *x, int *y); + +void wm_cursor_position_from_ghost_client_coords(wmWindow *win, int *x, int *y); +void wm_cursor_position_to_ghost_client_coords(wmWindow *win, int *x, int *y); #ifdef WITH_INPUT_IME void wm_window_IME_begin(wmWindow *win, int x, int y, int w, int h, bool complete); |