X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0bca03736369e836cce9297509505c5972e775dd..1fe0a566bbf649efe7cadc21e8ded82458c8bdc6:/src/gtk/notebook.cpp?ds=sidebyside diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 2e144a6a0b..25efc437f8 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -795,7 +795,22 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const } if ( flags ) + { *flags = wxNB_HITTEST_NOWHERE; + wxWindowBase * page = GetCurrentPage(); + if ( page ) + { + // rect origin is in notebook's parent coordinates + wxRect rect = page->GetRect(); + + // adjust it to the notebook's coordinates + wxPoint pos = GetPosition(); + rect.x -= pos.x; + rect.y -= pos.y; + if ( rect.Inside( pt ) ) + *flags |= wxNB_HITTEST_ONPAGE; + } + } return wxNOT_FOUND; }