cursor: Update focus at various additional points

- When XDG and XWayland views are positioned (view_moved()).
- When unmanaged XWayland surfaces are mapped, unmapped, or moved.

Do not update cursor focus during an out-of-surface drag.

Along with the existing call in desktop_move_to_front(), this
should hopefully cover the majority of cases where the cursor focus
could get out-of-date, with the possible exception of layer-shell
surfaces.
This commit is contained in:
John Lindgren 2022-09-03 17:46:53 -04:00
parent 2e81cc13d4
commit 469adc46d6
3 changed files with 11 additions and 1 deletions

View file

@ -27,6 +27,11 @@ is_surface(enum ssd_part_type view_area)
void
cursor_rebase(struct seat *seat, uint32_t time_msec, bool force)
{
if (seat->pressed.surface) {
/* Don't leave surface while a button is pressed */
return;
}
double sx, sy;
struct wlr_scene_node *node;
enum ssd_part_type view_area = LAB_SSD_NONE;
@ -41,7 +46,7 @@ cursor_rebase(struct seat *seat, uint32_t time_msec, bool force)
if (surface) {
if (!force && surface == seat->seat->pointer_state.focused_surface) {
/*
* Usually we prevent re-entering an already focued surface
* Usually we prevent re-entering an already focused surface
* because it sends useless leave and enter events.
*
* They may also seriously confuse clients if sent between