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>
Tue, 13 Jun 2023 10:01:29 +0000 (12:01 +0200)
commitf8fd04402eaf500abc72d5529165068660bd6911
tree0e842e146dcbc1211568d26949de838b47882322
parentdeac44962a7e0cce423745d83173e5909c11cf61
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.
gtk/gtkwindow.c