summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tizen/src/ui/menu/contextmenu.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp
index cec6373eea..2b5c182a47 100644
--- a/tizen/src/ui/menu/contextmenu.cpp
+++ b/tizen/src/ui/menu/contextmenu.cpp
@@ -75,11 +75,9 @@ void ContextMenu::createItems() {
addSeparator();
/* Always On Top menu */
-#ifndef CONFIG_DARWIN
actionTopMost = addAction("&Always on Top");
actionTopMost->setCheckable(true);
connect(actionTopMost, SIGNAL(triggered(bool)), this, SLOT(slotTopMost(bool)));
-#endif
/* = Rotate menu = */
if (win->uiInfo->mainFormList.count() > 1) {
@@ -269,7 +267,7 @@ void ContextMenu::slotTopMost(bool on)
HWND hWnd = (HWND)parent->winId();
HWND hWndInsertAfter = ((on == true) ? HWND_TOPMOST : HWND_NOTOPMOST);
SetWindowPos(hWnd, hWndInsertAfter, parent->pos().x(), parent->pos().y(), 0, 0, SWP_NOSIZE);
-#elif defined (CONFIG_LINUX)
+#elif defined(CONFIG_LINUX)
Display* display = XOpenDisplay(NULL);
if (display == NULL) {
qDebug("Error: XOpenDisplay() Failed. Always on top failed.");
@@ -293,8 +291,14 @@ void ContextMenu::slotTopMost(bool on)
XFlush(display);
XCloseDisplay(display);
-#elif defined (CONFIG_DARWIN)
- // TODO:
+#elif defined(CONFIG_DARWIN)
+ if (on == true) {
+ parent->setWindowFlags(parent->windowFlags() | Qt::WindowStaysOnTopHint);
+ } else {
+ parent->setWindowFlags(parent->windowFlags() & ~(Qt::WindowStaysOnTopHint));
+ }
+
+ parent->show();
#endif
actionTopMost->setChecked(on);