Commit bc347365 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Use better window placement heuristics for internal clients

Currently, we do some sort of window placement only for decorated
internal windows, which feels hacky.

With this change, all internal clients will go through the window
placement code, unless it's a popup or the BypassWindowManagerHint
flag is set.

If the BypassWindowManagerHint flag is set, the window must have
valid position.

CCBUG: 400675
parent 960a40ef
......@@ -211,6 +211,11 @@ bool InternalClient::isResizable() const
return true;
bool InternalClient::isPlaceable() const
return !(m_internalWindowFlags & Qt::BypassWindowManagerHint) && !(m_internalWindowFlags & Qt::Popup);
bool InternalClient::noBorder() const
return m_userNoBorder || m_internalWindowFlags.testFlag(Qt::FramelessWindowHint) || m_internalWindowFlags.testFlag(Qt::Popup);
......@@ -45,6 +45,7 @@ public:
bool isMovable() const override;
bool isMovableAcrossScreens() const override;
bool isResizable() const override;
bool isPlaceable() const override;
bool noBorder() const override;
bool userCanSetNoBorder() const override;
bool wantsInput() const override;
......@@ -1810,8 +1810,9 @@ void Workspace::addInternalClient(InternalClient *client)
if (client->isDecorated()) {
client->keepInArea(clientArea(FullScreenArea, client));
if (client->isPlaceable()) {
const QRect area = clientArea(PlacementArea, screens()->current(), client->desktop());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment