From d8c5a87fe39022f13ef4f48d5eba4407048e17b0 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 9 Feb 2024 12:52:30 -0800 Subject: [PATCH] Partial fix for wxSearchCtrl mouse enter/leave events The events only occur for part of the widget area, but it's better than the previous nothing. See #24245 --- include/wx/gtk/srchctrl.h | 3 +++ src/gtk/srchctrl.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/gtk/srchctrl.h b/include/wx/gtk/srchctrl.h index 5a37843472..b84358869d 100644 --- a/include/wx/gtk/srchctrl.h +++ b/include/wx/gtk/srchctrl.h @@ -96,6 +96,9 @@ private: #endif // wxUSE_MENUS/!wxUSE_MENUS } +protected: + virtual GdkWindow* GTKGetWindow(wxArrayGdkWindows& windows) const override; + private: virtual GtkEntry *GetEntry() const override { return m_entry; } diff --git a/src/gtk/srchctrl.cpp b/src/gtk/srchctrl.cpp index 9fb33b5f2c..6ec2833269 100644 --- a/src/gtk/srchctrl.cpp +++ b/src/gtk/srchctrl.cpp @@ -359,4 +359,13 @@ void wxSearchCtrl::PopupSearchMenu() #endif // wxUSE_MENUS +GdkWindow* wxSearchCtrl::GTKGetWindow(wxArrayGdkWindows& windows) const +{ +#ifdef __WXGTK3__ + GTKFindWindow(m_widget, windows); + return nullptr; +#else + return gtk_entry_get_text_window(GTK_ENTRY(m_widget)); +#endif +} #endif // wxUSE_SEARCHCTRL