Refactor the system tray's context menu
[quassel.git] / src / uisupport / graphicalui.cpp
index 2d1943f..8e5fe94 100644 (file)
@@ -101,9 +101,13 @@ bool GraphicalUi::checkMainWidgetVisibility(bool perform) {
   // therefore we watch for activation event and use our stopwatch :)
   if(GetTickCount() - _dwTickCount < 300) {
     // we were active in the last 300ms -> hide it
   // therefore we watch for activation event and use our stopwatch :)
   if(GetTickCount() - _dwTickCount < 300) {
     // we were active in the last 300ms -> hide it
-    minimizeRestore(false);
+    if(perform)
+      minimizeRestore(false);
+    return false;
   } else {
   } else {
-    minimizeRestore(true);
+    if(perform)
+      minimizeRestore(true);
+    return true;
   }
 
 #elif defined(HAVE_KDE) && defined(Q_WS_X11)
   }
 
 #elif defined(HAVE_KDE) && defined(Q_WS_X11)
@@ -182,6 +186,10 @@ bool GraphicalUi::checkMainWidgetVisibility(bool perform) {
   return true;
 }
 
   return true;
 }
 
+bool GraphicalUi::isMainWidgetVisible() {
+  return !instance()->checkMainWidgetVisibility(false);
+}
+
 void GraphicalUi::minimizeRestore(bool show) {
   if(show)
     activateMainWidget();
 void GraphicalUi::minimizeRestore(bool show) {
   if(show)
     activateMainWidget();