diff --git a/abstract_client.cpp b/abstract_client.cpp index 41124881d..bac6ca25f 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -3087,6 +3087,9 @@ void AbstractClient::sendToScreen(int newScreen) void AbstractClient::checkWorkspacePosition(QRect oldGeometry, int oldDesktop, QRect oldClientGeometry) { + if (isDock() || isDesktop() || !isPlaceable()) { + return; + } enum { Left = 0, Top, Right, Bottom }; const int border[4] = { borderLeft(), borderTop(), borderRight(), borderBottom() }; if( !oldGeometry.isValid()) @@ -3095,16 +3098,12 @@ void AbstractClient::checkWorkspacePosition(QRect oldGeometry, int oldDesktop, Q oldDesktop = desktop(); if (!oldClientGeometry.isValid()) oldClientGeometry = oldGeometry.adjusted(border[Left], border[Top], -border[Right], -border[Bottom]); - if (isDesktop()) - return; if (isFullScreen()) { QRect area = workspace()->clientArea(FullScreenArea, this); if (frameGeometry() != area) setFrameGeometry(area); return; } - if (isDock()) - return; if (maximizeMode() != MaximizeRestore) { GeometryUpdatesBlocker block(this); @@ -3513,4 +3512,9 @@ void AbstractClient::showOnScreenEdge() qCWarning(KWIN_CORE, "%s doesn't support screen edge activation", metaObject()->className()); } +bool AbstractClient::isPlaceable() const +{ + return true; +} + } diff --git a/abstract_client.h b/abstract_client.h index 0035dc378..30f255f88 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -405,6 +405,7 @@ public: * @see captionNormal */ virtual QString captionSuffix() const = 0; + virtual bool isPlaceable() const; virtual bool isCloseable() const = 0; // TODO: remove boolean trap virtual bool isShown(bool shaded_is_shown) const = 0; diff --git a/inputpanelv1client.h b/inputpanelv1client.h index 709208e89..044321bb8 100644 --- a/inputpanelv1client.h +++ b/inputpanelv1client.h @@ -33,6 +33,7 @@ public: void destroyClient() override; QRect bufferGeometry() const override { return frameGeometry(); } + bool isPlaceable() const override { return false; } bool isCloseable() const override { return false; } bool isResizable() const override { return false; } bool isMovable() const override { return false; } diff --git a/workspace.cpp b/workspace.cpp index 50467d3c3..13b1a4edc 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -706,22 +706,24 @@ void Workspace::addShellClient(AbstractClient *client) client->updateDecoration(false); updateClientLayer(client); - const QRect area = clientArea(PlacementArea, Screens::self()->current(), client->desktop()); - bool placementDone = false; - if (client->isInitialPositionSet()) { - placementDone = true; - } - if (client->isFullScreen()) { - placementDone = true; - } - if (client->maximizeMode() == MaximizeMode::MaximizeFull) { - placementDone = true; - } - if (client->rules()->checkPosition(invalidPoint, true) != invalidPoint) { - placementDone = true; - } - if (!placementDone) { - client->placeIn(area); + if (client->isPlaceable()) { + const QRect area = clientArea(PlacementArea, Screens::self()->current(), client->desktop()); + bool placementDone = false; + if (client->isInitialPositionSet()) { + placementDone = true; + } + if (client->isFullScreen()) { + placementDone = true; + } + if (client->maximizeMode() == MaximizeMode::MaximizeFull) { + placementDone = true; + } + if (client->rules()->checkPosition(invalidPoint, true) != invalidPoint) { + placementDone = true; + } + if (!placementDone) { + client->placeIn(area); + } } m_allClients.append(client); if (!unconstrained_stacking_order.contains(client)) { @@ -2195,9 +2197,7 @@ void Workspace::updateClientArea(bool force) for (auto it = m_allClients.constBegin(); it != m_allClients.constEnd(); ++it) { - if (!(*it)->isInputMethod()) { - (*it)->checkWorkspacePosition(); - } + (*it)->checkWorkspacePosition(); } oldrestrictedmovearea.clear(); // reset, no longer valid or needed