Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show First 20 Lines • Show All 1253 Lines • ▼ Show 20 Line(s) | 1233 | { | |||
---|---|---|---|---|---|
1254 | updateMaximizeMode(maximizeMode); | 1254 | updateMaximizeMode(maximizeMode); | ||
1255 | } | 1255 | } | ||
1256 | 1256 | | |||
1257 | void ShellClient::clientFullScreenChanged(bool fullScreen) | 1257 | void ShellClient::clientFullScreenChanged(bool fullScreen) | ||
1258 | { | 1258 | { | ||
1259 | setFullScreen(fullScreen, false); | 1259 | setFullScreen(fullScreen, false); | ||
1260 | } | 1260 | } | ||
1261 | 1261 | | |||
1262 | void ShellClient::resizeWithChecks(int w, int h, ForceGeometry_t force) | 1262 | void ShellClient::resizeWithChecks(const QSize &size, ForceGeometry_t force) | ||
1263 | { | 1263 | { | ||
1264 | Q_UNUSED(force) | 1264 | Q_UNUSED(force) | ||
1265 | QRect area = workspace()->clientArea(WorkArea, this); | 1265 | | ||
1266 | // don't allow growing larger than workarea | 1266 | // Resize to fit the work area if needed. | ||
1267 | if (w > area.width()) { | 1267 | const QRect workArea = workspace()->clientArea(WorkArea, this); | ||
1268 | w = area.width(); | 1268 | const QSize clampedSize = size.boundedTo(workArea.size()); | ||
1269 | } | 1269 | | ||
1270 | if (h > area.height()) { | | |||
1271 | h = area.height(); | | |||
1272 | } | | |||
1273 | if (m_shellSurface) { | 1270 | if (m_shellSurface) { | ||
1274 | m_shellSurface->requestSize(QSize(w, h)); | 1271 | m_shellSurface->requestSize(clampedSize); | ||
1275 | } | 1272 | } | ||
1276 | if (m_xdgShellSurface) { | 1273 | if (m_xdgShellSurface) { | ||
1277 | m_xdgShellSurface->configure(xdgSurfaceStates(), QSize(w, h)); | 1274 | m_xdgShellSurface->configure(xdgSurfaceStates(), clampedSize); | ||
1278 | } | 1275 | } | ||
1279 | } | 1276 | } | ||
1280 | 1277 | | |||
1281 | void ShellClient::unmap() | 1278 | void ShellClient::unmap() | ||
1282 | { | 1279 | { | ||
1283 | m_unmapped = true; | 1280 | m_unmapped = true; | ||
1284 | if (isMoveResize()) { | 1281 | if (isMoveResize()) { | ||
1285 | leaveMoveResize(); | 1282 | leaveMoveResize(); | ||
▲ Show 20 Lines • Show All 734 Lines • Show Last 20 Lines |