Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.cpp
Show First 20 Lines • Show All 802 Lines • ▼ Show 20 Line(s) | 802 | { | |||
---|---|---|---|---|---|
803 | if (partial) { | 803 | if (partial) { | ||
804 | // increase the area so that can have only 100 pixels in the area | 804 | // increase the area so that can have only 100 pixels in the area | ||
805 | area.setLeft(qMin(area.left() - width() + 100, area.left())); | 805 | area.setLeft(qMin(area.left() - width() + 100, area.left())); | ||
806 | area.setTop(qMin(area.top() - height() + 100, area.top())); | 806 | area.setTop(qMin(area.top() - height() + 100, area.top())); | ||
807 | area.setRight(qMax(area.right() + width() - 100, area.right())); | 807 | area.setRight(qMax(area.right() + width() - 100, area.right())); | ||
808 | area.setBottom(qMax(area.bottom() + height() - 100, area.bottom())); | 808 | area.setBottom(qMax(area.bottom() + height() - 100, area.bottom())); | ||
809 | } | 809 | } | ||
810 | if (!partial) { | 810 | if (!partial) { | ||
811 | // resize to fit into area | 811 | // Resize to fit into area. | ||
812 | if (area.width() < width() || area.height() < height()) | 812 | const QSize currentSize = size(); | ||
813 | resizeWithChecks(qMin(area.width(), width()), qMin(area.height(), height())); | 813 | const QSize clampedSize = currentSize.boundedTo(area.size()); | ||
814 | if (currentSize != clampedSize) { | ||||
815 | resizeWithChecks(clampedSize); | ||||
816 | } | ||||
814 | } | 817 | } | ||
815 | int tx = x(), ty = y(); | 818 | int tx = x(), ty = y(); | ||
816 | if (geometry().right() > area.right() && width() <= area.width()) | 819 | if (geometry().right() > area.right() && width() <= area.width()) | ||
817 | tx = area.right() - width() + 1; | 820 | tx = area.right() - width() + 1; | ||
818 | if (geometry().bottom() > area.bottom() && height() <= area.height()) | 821 | if (geometry().bottom() > area.bottom() && height() <= area.height()) | ||
819 | ty = area.bottom() - height() + 1; | 822 | ty = area.bottom() - height() + 1; | ||
820 | if (!area.contains(geometry().topLeft())) { | 823 | if (!area.contains(geometry().topLeft())) { | ||
821 | if (tx < area.x()) | 824 | if (tx < area.x()) | ||
▲ Show 20 Lines • Show All 1265 Lines • ▼ Show 20 Line(s) | 2089 | { | |||
2087 | return false; | 2090 | return false; | ||
2088 | } | 2091 | } | ||
2089 | 2092 | | |||
2090 | bool AbstractClient::supportsWindowRules() const | 2093 | bool AbstractClient::supportsWindowRules() const | ||
2091 | { | 2094 | { | ||
2092 | return true; | 2095 | return true; | ||
2093 | } | 2096 | } | ||
2094 | 2097 | | |||
2098 | QMargins AbstractClient::frameMargins() const | ||||
2099 | { | ||||
2100 | return QMargins(borderLeft(), borderTop(), borderRight(), borderBottom()); | ||||
2101 | } | ||||
2102 | | ||||
2095 | } | 2103 | } |