summaryrefslogtreecommitdiff
path: root/tizen/src/ui/menu
diff options
context:
space:
mode:
authorGiWoong Kim <giwoong.kim@samsung.com>2016-02-22 16:03:43 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2016-03-08 11:14:20 +0900
commit4ad58ef2caf78ff6e30435f5d6cf66ae703da5e3 (patch)
treed48314d32ffef1bad8275c14fb91f86552949202 /tizen/src/ui/menu
parentbffa8641c7b0a6f3129dcc019ddef128c949fe42 (diff)
downloadqemu-4ad58ef2caf78ff6e30435f5d6cf66ae703da5e3.tar.gz
qemu-4ad58ef2caf78ff6e30435f5d6cf66ae703da5e3.tar.bz2
qemu-4ad58ef2caf78ff6e30435f5d6cf66ae703da5e3.zip
menu: modify event filter rule
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>
Diffstat (limited to 'tizen/src/ui/menu')
-rw-r--r--tizen/src/ui/menu/contextmenu.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp
index 1c14d00e47..fb7e4b4dcb 100644
--- a/tizen/src/ui/menu/contextmenu.cpp
+++ b/tizen/src/ui/menu/contextmenu.cpp
@@ -629,8 +629,13 @@ bool ContextMenu::eventFilter(QObject *obj, QEvent *event)
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) {