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: 400675master
parent
960a40ef44
commit
bc34736534
|
@ -211,6 +211,11 @@ bool InternalClient::isResizable() const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InternalClient::isPlaceable() const
|
||||||
|
{
|
||||||
|
return !(m_internalWindowFlags & Qt::BypassWindowManagerHint) && !(m_internalWindowFlags & Qt::Popup);
|
||||||
|
}
|
||||||
|
|
||||||
bool InternalClient::noBorder() const
|
bool InternalClient::noBorder() const
|
||||||
{
|
{
|
||||||
return m_userNoBorder || m_internalWindowFlags.testFlag(Qt::FramelessWindowHint) || m_internalWindowFlags.testFlag(Qt::Popup);
|
return m_userNoBorder || m_internalWindowFlags.testFlag(Qt::FramelessWindowHint) || m_internalWindowFlags.testFlag(Qt::Popup);
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
bool isMovable() const override;
|
bool isMovable() const override;
|
||||||
bool isMovableAcrossScreens() const override;
|
bool isMovableAcrossScreens() const override;
|
||||||
bool isResizable() const override;
|
bool isResizable() const override;
|
||||||
|
bool isPlaceable() const override;
|
||||||
bool noBorder() const override;
|
bool noBorder() const override;
|
||||||
bool userCanSetNoBorder() const override;
|
bool userCanSetNoBorder() const override;
|
||||||
bool wantsInput() const override;
|
bool wantsInput() const override;
|
||||||
|
|
|
@ -1810,8 +1810,9 @@ void Workspace::addInternalClient(InternalClient *client)
|
||||||
setupClientConnections(client);
|
setupClientConnections(client);
|
||||||
client->updateLayer();
|
client->updateLayer();
|
||||||
|
|
||||||
if (client->isDecorated()) {
|
if (client->isPlaceable()) {
|
||||||
client->keepInArea(clientArea(FullScreenArea, client));
|
const QRect area = clientArea(PlacementArea, screens()->current(), client->desktop());
|
||||||
|
client->placeIn(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
markXStackingOrderAsDirty();
|
markXStackingOrderAsDirty();
|
||||||
|
|
Loading…
Reference in New Issue