Generate wxEVT_ENTER_WINDOW in icon part of wxSearchCtrl in wxGTK

Mouse motion events happening over GtkEntry icons are consumed by this
class "event" callback, which simply returns GDK_EVENT_STOP for them if
the icon is insensitive (which is the case for GtkSearchEntry) and so
our "enter-notify-event" callback is never called.

Fix this by handling "event" signal ourselves and generating
wxEVT_ENTER_WINDOW from it if necessary.

Doing this required adding a global pointer to the window currently
under mouse, which is also used for generating wxEVT_LEAVE_WINDOW if
necessary.

See #24245.
This commit is contained in:
Vadim Zeitlin 2024-02-18 20:18:42 +01:00
parent a8b4753d1d
commit 9205da74db
3 changed files with 74 additions and 0 deletions

View file

@ -88,6 +88,12 @@ template<typename T> void InitMouseEvent(wxWindowGTK *win,
event.SetTimestamp( gdk_event->time );
}
// Update the window currently known to be under the mouse pointer.
//
// Returns true if it was updated, false if this window was already known to
// contain the mouse pointer.
bool SetWindowUnderMouse(wxWindowGTK* win);
} // namespace wxGTKImpl
#endif // _GTK_PRIVATE_EVENT_H_