#include "dolphindockwidget.h"
+#include <QEvent>
#include <QStyle>
namespace
m_dockTitleBar = new DolphinDockTitleBar(this);
}
setTitleBarWidget(m_dockTitleBar);
- setFeatures(QDockWidget::NoDockWidgetFeatures);
+ setFeatures(QDockWidget::DockWidgetClosable);
} else {
setTitleBarWidget(nullptr);
setFeatures(DefaultDockWidgetFeatures);
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"