]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindockwidget.cpp
DolphinStatusbar: Fix background and margins for non-Breeze styles
[dolphin.git] / src / dolphindockwidget.cpp
index 930c38e355d8d6c7151e46a3bc8ca6d679067d80..5e79e03163c530439edc314f58bb134eb83969f7 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "dolphindockwidget.h"
 
+#include <QEvent>
 #include <QStyle>
 
 namespace
@@ -77,5 +78,21 @@ bool DolphinDockWidget::isLocked() const
     return m_locked;
 }
 
+bool DolphinDockWidget::event(QEvent *event)
+{
+    switch (event->type()) {
+    case QEvent::Show:
+    case QEvent::Hide:
+        if (event->spontaneous()) {
+            // The Dolphin window has been minimized or restored. We do not want this to be interpreted like a user was toggling the visibility of this widget.
+            // We return here so no QDockWidget::visibilityChanged() signal is emitted. This does not seem to happen either way on Wayland.
+            return true;
+        }
+        [[fallthrough]];
+    default:
+        return QDockWidget::event(event);
+    }
+}
+
 #include "dolphindockwidget.moc"
 #include "moc_dolphindockwidget.cpp"