Commit fb114dfb authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Return early if we ignore resize increments and aspect ratio constraints

Summary:
If we know that we are going to disobey resize increment and aspect ratio
geometry hints, then there is no point for trying to constrain the client
size according to those hints. Just return early.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27031
parent b8f1c09c
......@@ -3625,8 +3625,11 @@ QSize X11Client::constrainClientSize(const QSize &size, SizeMode mode) const
w = qMax(min_size.width(), w);
h = qMax(min_size.height(), h);
int w1 = w;
int h1 = h;
if (!rules()->checkStrictGeometry(!isFullScreen())) {
// Disobey increments and aspect by explicit rule.
return QSize(w, h);
}
int width_inc = m_geometryHints.resizeIncrements().width();
int height_inc = m_geometryHints.resizeIncrements().height();
int basew_inc = m_geometryHints.baseSize().width();
......@@ -3750,11 +3753,6 @@ QSize X11Client::constrainClientSize(const QSize &size, SizeMode mode) const
w += baseSize.width();
h += baseSize.height();
}
if (!rules()->checkStrictGeometry(!isFullScreen())) {
// disobey increments and aspect by explicit rule
w = w1;
h = h1;
}
return QSize(w, h);
}
......
Markdown is supported
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