X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0bca03736369e836cce9297509505c5972e775dd..6c73e20df7f3a7ea8c2059a816ffd3655ea2b848:/src/gtk/notebook.cpp 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; }