diff --git a/src/redkite/include/impl/RkEventQueueImpl.h b/src/redkite/include/impl/RkEventQueueImpl.h index aa54c132..7eba8400 100755 --- a/src/redkite/include/impl/RkEventQueueImpl.h +++ b/src/redkite/include/impl/RkEventQueueImpl.h @@ -70,6 +70,7 @@ class RkEventQueue::RkEventQueueImpl { void processQueue(); void addPopup(RkWidget* popup); void removePopup(RkWidget* popup); + const std::vector& getPopupWidgets() const; protected: void processPopups(RkWidget *widget, RkEvent* event); diff --git a/src/redkite/src/RkEventQueueImpl.cpp b/src/redkite/src/RkEventQueueImpl.cpp index 857461cb..92b993e2 100755 --- a/src/redkite/src/RkEventQueueImpl.cpp +++ b/src/redkite/src/RkEventQueueImpl.cpp @@ -339,3 +339,8 @@ void RkEventQueue::RkEventQueueImpl::removePopup(RkWidget* popup) RK_LOG_DEV_DEBUG("REMOVE POPUP: " << popup); popupList.erase(std::remove(popupList.begin(), popupList.end(), popup), popupList.end()); } + +const std::vector& RkEventQueue::RkEventQueueImpl::getPopupWidgets() const +{ + return popupList; +} diff --git a/src/redkite/src/RkSystemWindow.cpp b/src/redkite/src/RkSystemWindow.cpp index 8deafe5d..5424229c 100755 --- a/src/redkite/src/RkSystemWindow.cpp +++ b/src/redkite/src/RkSystemWindow.cpp @@ -266,6 +266,11 @@ bool RkSystemWindow::containsGlobalPoint(RkWidget* widget, const RkPoint &global RkWidget* RkSystemWindow::getWidgetByGlobalPoint(RkWidget *widget, const RkPoint &globalPoint) { + for (auto &popupWidget: RK_IMPL_PTR(topWidget->eventQueue())->getPopupWidgets()) { + if (containsGlobalPoint(popupWidget, globalPoint)) + return popupWidget; + } + for (auto &child: widget->children()) { auto childWidget = dynamic_cast(child); if (childWidget && childWidget->isVisible() diff --git a/src/redkite/src/RkWidgetImpl.cpp b/src/redkite/src/RkWidgetImpl.cpp index 287f7bf3..7e749d5d 100755 --- a/src/redkite/src/RkWidgetImpl.cpp +++ b/src/redkite/src/RkWidgetImpl.cpp @@ -260,8 +260,8 @@ void RkWidget::RkWidgetImpl::event(RkEvent *event) void RkWidget::RkWidgetImpl::processPaintEvent(RkPaintEvent* event) { - // if (!name().empty()) - // RK_LOG_DEV_DEBUG("name :" << name() << ", visible: " << isVisible()); + if (!name().empty()) + RK_LOG_DEV_DEBUG("name :" << name() << ", visible: " << isVisible()); RkPainter painter(inf_ptr); auto globalPosition = inf_ptr->mapToGlobal({0, 0}); painter.translate(globalPosition); @@ -503,10 +503,10 @@ void RkWidget::RkWidgetImpl::setChildrenVisible(bool b) continue; RK_IMPL_PTR(widget)->setVisible(b); RK_IMPL_PTR(widget)->setChildrenVisible(b); - // if (!RK_IMPL_PTR(widget)->name().empty()) - // RK_LOG_DEV_DEBUG(" ch: " - // << RK_IMPL_PTR(widget)->name() - // << " : visible: " << b); + if (!RK_IMPL_PTR(widget)->name().empty()) + RK_LOG_DEV_DEBUG(" ch: " + << RK_IMPL_PTR(widget)->name() + << " : visible: " << b); } } }