window: Clear resize_cursor on leave notify events
authorMichel Dänzer <mdaenzer@redhat.com>
Mon, 12 Jun 2023 16:28:29 +0000 (18:28 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sun, 25 Jun 2023 18:40:34 +0000 (20:40 +0200)
commit8362e1889134eb66e98b5d65be5e7baa199a4983
tree07a3b01daec4757a49118d6ea2114d6ac98fb44f
parent08d4d63446bb9d965b79433a25a1753bb4fe3e0d
window: Clear resize_cursor on leave notify events

When the pointer leaves the window surface, gtk_window_capture_motion
will not be called anymore, so priv->resize_cursor may remain non-NULL
indefinitely without this.

If update_cursor is later called (via gtk_window_maybe_update_cursor) on
a virtual enter notify event (e.g. because the pointer entered a
descendant surface), it would previously re-set the window surface
cursor to priv->resize_cursor, which could result in the wrong cursor
shape being shown for descendant surfaces.

This affected mutter-x11-frames, see
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1557.

One could also say that if the pointer leaves the window surface, it's
trivially not over any window edge.

(cherry-picked from commit f8fd04402eaf500abc72d5529165068660bd6911)
gtk/gtkwindow.c