Set attribute Qt::WA_X11NetWmWindowTypeDock permanently for floating widgets

This commit is contained in:
Uwe Kindler 2019-11-28 13:45:15 +01:00
parent 3332f6050e
commit 5978aaaedc
2 changed files with 4 additions and 3 deletions

View File

@ -232,7 +232,7 @@ void MainWindowPrivate::createContent()
// Test creation of floating dock widgets
DockWidget = createFileSystemTreeDockWidget(ViewMenu);
auto FloatingWidget = DockManager->addDockWidgetFloating(DockWidget);
FloatingWidget->move(QPoint(0, 0));
FloatingWidget->move(QPoint(20, 20));
FloatingWidget = DockManager->addDockWidgetFloating(createLongTextLabelDockWidget(ViewMenu));
FloatingWidget->move(QPoint(100, 100));

View File

@ -249,6 +249,7 @@ CFloatingDockContainer::CFloatingDockContainer(CDockManager *DockManager) :
QDockWidget::setFeatures(QDockWidget::AllDockWidgetFeatures);
setTitleBarWidget(d->TitleBar);
connect(d->TitleBar, SIGNAL(closeRequested()), SLOT(close()));
setAttribute(Qt::WA_X11NetWmWindowTypeDock, true);
#else
setWindowFlags(
Qt::Window | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
@ -509,7 +510,7 @@ void CFloatingDockContainer::startFloating(const QPoint &DragStartMousePos,
#ifdef Q_OS_LINUX
if (DraggingFloatingWidget == DragState)
{
setAttribute(Qt::WA_X11NetWmWindowTypeDock, true);
//setAttribute(Qt::WA_X11NetWmWindowTypeDock, true);
d->MouseEventHandler = MouseEventHandler;
if (d->MouseEventHandler)
{
@ -619,7 +620,7 @@ void CFloatingDockContainer::finishDragging()
{
ADS_PRINT("CFloatingDockContainer::finishDragging");
#ifdef Q_OS_LINUX
setAttribute(Qt::WA_X11NetWmWindowTypeDock, false);
//setAttribute(Qt::WA_X11NetWmWindowTypeDock, false);
setWindowOpacity(1);
activateWindow();
if (d->MouseEventHandler)