13#include "core/FloatingWindow_p.h"
14#include "kddockwidgets/core/FloatingWindow.h"
15#include "kddockwidgets/core/Group.h"
16#include "kddockwidgets/core/TitleBar.h"
17#include "kddockwidgets/core/MainWindow.h"
18#include "kddockwidgets/core/DropArea.h"
20#include "core/Logging_p.h"
21#include "core/Utils_p.h"
22#include "core/View_p.h"
23#include "core/DragController_p.h"
24#include "core/WidgetResizeHandler_p.h"
25#include "core/DockRegistry_p.h"
29#include <QApplication>
34#include <QWindowStateChangeEvent>
43class FloatingWindow::Private
54 bool m_connectedToScreenChanged =
false;
62 , d(new Private(this, controller))
83 const qreal halfPenWidth = p.
pen().
widthF() / 2;
85 p.
drawRect(rectf.
adjusted(halfPenWidth, halfPenWidth, -halfPenWidth, -halfPenWidth));
99 if (d->m_controller->titleBar()->isFloating()) {
101 d->m_controller->titleBar()->onFloatClicked();
112 d->m_connectedToScreenChanged =
true;
120 d->m_controller->dptr()->activatedChanged.emit();
131 d->m_numGroupsChangedConnection = d->m_controller->dptr()->numGroupsChanged.connect([
this] {
135 d->m_vlayout->setSpacing(0);
137 d->m_vlayout->addWidget(View_qt::asQWidget(d->m_controller->titleBar()));
138 d->m_vlayout->addWidget(View_qt::asQWidget(d->m_controller->dropArea()));
140 d->m_screenChangedConnection =
DockRegistry::self()->
dptr()->windowChangedScreen.connect([
this](Core::Window::Ptr w) {
146void FloatingWindow::updateMargins()
153 return d->m_controller;
166 d->m_controller->dptr()->windowStateChanged.emit();
175 Qt5Qt6Compat::qintptr *result)
178 if (fw->beingDeleted())
181 if (KDDockWidgets::usesAeroSnapWithCustomDecos()) {
183 if (WidgetResizeHandler::handleWindowsNativeEvent(fw, eventType, message, result))
185 }
else if (KDDockWidgets::usesNativeTitleBar()) {
186 auto msg =
static_cast<MSG *
>(message);
187 if (msg->message == WM_SIZING) {
189 Core::DragController::instance()->dragCanceled.emit();
A ScopedConnection is a RAII-style way to make sure a Connection is disconnected.
NonClientAreaMouseButtonDblClick
bool spontaneous() const const
QEvent::Type type() const const
virtual bool event(QEvent *e)
void installEventFilter(QObject *filterObj)
QObject * parent() const const
void drawRect(const QRectF &rectangle)
const QPen & pen() const const
void setPen(const QColor &color)
void setJoinStyle(Qt::PenJoinStyle style)
qreal widthF() const const
QRectF adjusted(qreal dx1, qreal dy1, qreal dx2, qreal dy2) const const