Do not filter out a right-click event when it is triggerd
at outside of menu. But, still need a event filtering at
inside of menu to prevent the selection mistake.
Change-Id: Ieb453a6d9b68cbce875cc7a58e805fa73a47adcf
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent *>(event);
if (mouseEvent != NULL && mouseEvent->button() == Qt::RightButton) {
- mouseEvent->ignore(); /* filtering */
- return true;
+ /* if menu was selected then filter out the this event */
+ if (mouseEvent->x() >= 0 && mouseEvent->y() >= 0 &&
+ mouseEvent->x() <= geometry().width() &&
+ mouseEvent->y() <= geometry().height()) {
+ mouseEvent->ignore(); /* filtering */
+ return true;
+ }
}
} else if (event->type() == QEvent::Show) {
if (parent->getMainView()->isGrabWindow() == true) {