mirror of
https://github.com/labwc/labwc.git
synced 2026-03-09 05:33:53 -04:00
cursor: Call wlr_seat_pointer_notify_clear_focus() only if needed
@Consolatis determined that apparently the extra "clear focus" event confuses the drag source during drag-and-drop. Fixes drag-and-drop of files into folders within the same Thunar window.
This commit is contained in:
parent
cfdf60b1da
commit
cd970945f4
1 changed files with 7 additions and 3 deletions
10
src/cursor.c
10
src/cursor.c
|
|
@ -369,8 +369,10 @@ cursor_update_common(struct server *server, struct cursor_context *ctx,
|
||||||
* cursor image will be set by request_cursor_notify()
|
* cursor image will be set by request_cursor_notify()
|
||||||
* in response to the enter event.
|
* in response to the enter event.
|
||||||
*/
|
*/
|
||||||
if (ctx->surface != wlr_seat->pointer_state.focused_surface
|
bool has_focus = (ctx->surface ==
|
||||||
|| seat->server_cursor != LAB_CURSOR_CLIENT) {
|
wlr_seat->pointer_state.focused_surface);
|
||||||
|
|
||||||
|
if (!has_focus || seat->server_cursor != LAB_CURSOR_CLIENT) {
|
||||||
/*
|
/*
|
||||||
* Enter the surface if necessary. Usually we
|
* Enter the surface if necessary. Usually we
|
||||||
* prevent re-entering an already focused
|
* prevent re-entering an already focused
|
||||||
|
|
@ -382,7 +384,9 @@ cursor_update_common(struct server *server, struct cursor_context *ctx,
|
||||||
* if a server-side cursor was set and we need
|
* if a server-side cursor was set and we need
|
||||||
* to trigger a cursor image update.
|
* to trigger a cursor image update.
|
||||||
*/
|
*/
|
||||||
wlr_seat_pointer_notify_clear_focus(wlr_seat);
|
if (has_focus) {
|
||||||
|
wlr_seat_pointer_notify_clear_focus(wlr_seat);
|
||||||
|
}
|
||||||
wlr_seat_pointer_notify_enter(wlr_seat, ctx->surface,
|
wlr_seat_pointer_notify_enter(wlr_seat, ctx->surface,
|
||||||
ctx->sx, ctx->sy);
|
ctx->sx, ctx->sy);
|
||||||
seat->server_cursor = LAB_CURSOR_CLIENT;
|
seat->server_cursor = LAB_CURSOR_CLIENT;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue