From: Rémi Bernon <rbernon@codeweavers.com> --- server/queue.c | 10 ++++++++++ server/user.h | 1 + server/window.c | 12 ++++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/server/queue.c b/server/queue.c index a04b53b70de..b23298e3d5f 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2250,6 +2250,16 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons time = input->mouse.time; if (!time) time = desktop_shm->cursor.last_change; + if (win && origin == IMO_HARDWARE && flags == (MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE)) + { + struct rectangle rect = { input->mouse.x, input->mouse.y, input->mouse.x + 1, input->mouse.y + 1 }; + unsigned char state = (desktop_shm->keystate[VK_LBUTTON] | desktop_shm->keystate[VK_MBUTTON] | + desktop_shm->keystate[VK_RBUTTON] | desktop_shm->keystate[VK_XBUTTON1] | + desktop_shm->keystate[VK_XBUTTON2]) & 0x80; + input_shm_t *input_shm = sender && sender->input ? sender->input->shared : NULL; + if (!state && input_shm && !input_shm->capture) set_window_rect_visible( win, rect ); + } + if (flags & MOUSEEVENTF_MOVE) { if (flags & MOUSEEVENTF_ABSOLUTE) diff --git a/server/user.h b/server/user.h index 1d16e2aab95..1997029b0e9 100644 --- a/server/user.h +++ b/server/user.h @@ -184,6 +184,7 @@ extern user_handle_t shallow_window_from_point( struct desktop *desktop, int x, extern struct thread *window_thread_from_point( user_handle_t scope, int x, int y ); extern user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread ); extern struct window_class *get_window_class( user_handle_t window ); +extern void set_window_rect_visible( user_handle_t window, struct rectangle rect ); /* window class functions */ diff --git a/server/window.c b/server/window.c index 059f9be1e09..e6d5a6d377b 100644 --- a/server/window.c +++ b/server/window.c @@ -3031,12 +3031,12 @@ DECL_HANDLER(get_update_region) /* update the z order of a window so that a given rectangle is fully visible */ -DECL_HANDLER(update_window_zorder) +void set_window_rect_visible( user_handle_t window, struct rectangle rect ) { - struct rectangle tmp, rect = req->rect; - struct window *ptr, *win = get_window( req->window ); + struct window *ptr, *win; + struct rectangle tmp; - if (!win || !win->parent || !is_visible( win )) return; /* nothing to do */ + if (!(win = get_window( window )) || !win->parent || !is_visible( win )) return; /* nothing to do */ map_point_raw_to_virt( win->desktop, &rect.left, &rect.top ); map_point_raw_to_virt( win->desktop, &rect.right, &rect.bottom ); @@ -3068,6 +3068,10 @@ DECL_HANDLER(update_window_zorder) } } +DECL_HANDLER(update_window_zorder) +{ + set_window_rect_visible( req->window, req->rect ); +} /* mark parts of a window as needing a redraw */ DECL_HANDLER(redraw_window) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11173