diff --git a/modules/gui/qt/maininterface/interface_window_handler.cpp b/modules/gui/qt/maininterface/interface_window_handler.cpp
index 7c191bf5c306557ff8b63d01a72cd7e825987005..aa9ad38ca7cbdfef63f44ea7cf4fb956658fab65 100644
--- a/modules/gui/qt/maininterface/interface_window_handler.cpp
+++ b/modules/gui/qt/maininterface/interface_window_handler.cpp
@@ -246,14 +246,15 @@ bool InterfaceWindowHandler::eventFilter(QObject*, QEvent* event)
     }
     case QEvent::Close:
     {
+        setInterfaceHiden();
+
         if (var_InheritBool(p_intf, "qt-close-to-system-tray"))
         {
             if (const QSystemTrayIcon* const sysTrayIcon = m_mainCtx->getSysTray())
             {
                 if (sysTrayIcon->isSystemTrayAvailable() && sysTrayIcon->isVisible())
                 {
-                    setInterfaceHiden();
-                    event->accept();
+                    event->ignore();
                     return true;
                 }
             }