correct workspace position in case of quicktiling or touching the border when the decoration padding changes
This commit is contained in:
parent
9442855834
commit
05cbf3f1ca
3 changed files with 15 additions and 7 deletions
|
@ -373,7 +373,7 @@ void Client::updateDecoration(bool check_workspace_pos, bool force)
|
||||||
} else
|
} else
|
||||||
destroyDecoration();
|
destroyDecoration();
|
||||||
if (check_workspace_pos)
|
if (check_workspace_pos)
|
||||||
checkWorkspacePosition();
|
checkWorkspacePosition(oldgeom);
|
||||||
blockGeometryUpdates(false);
|
blockGeometryUpdates(false);
|
||||||
if (!noBorder())
|
if (!noBorder())
|
||||||
decoration->widget()->show();
|
decoration->widget()->show();
|
||||||
|
@ -441,8 +441,9 @@ bool Client::checkBorderSizes(bool also_resize)
|
||||||
border_top = new_top;
|
border_top = new_top;
|
||||||
border_bottom = new_bottom;
|
border_bottom = new_bottom;
|
||||||
move(calculateGravitation(false));
|
move(calculateGravitation(false));
|
||||||
|
QRect oldgeom = geometry();
|
||||||
plainResize(sizeForClientSize(clientSize()), ForceGeometrySet);
|
plainResize(sizeForClientSize(clientSize()), ForceGeometrySet);
|
||||||
checkWorkspacePosition();
|
checkWorkspacePosition(oldgeom);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
client.h
2
client.h
|
@ -314,7 +314,7 @@ public:
|
||||||
|
|
||||||
void gotPing(Time timestamp);
|
void gotPing(Time timestamp);
|
||||||
|
|
||||||
void checkWorkspacePosition();
|
void checkWorkspacePosition(const QRect &geo = QRect());
|
||||||
void updateUserTime(Time time = CurrentTime);
|
void updateUserTime(Time time = CurrentTime);
|
||||||
Time userTime() const;
|
Time userTime() const;
|
||||||
bool hasUserTimeSupport() const;
|
bool hasUserTimeSupport() const;
|
||||||
|
|
15
geometry.cpp
15
geometry.cpp
|
@ -1013,7 +1013,7 @@ bool Client::hasOffscreenXineramaStrut() const
|
||||||
return !region.isEmpty();
|
return !region.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::checkWorkspacePosition()
|
void Client::checkWorkspacePosition(const QRect &geo)
|
||||||
{
|
{
|
||||||
if (isDesktop())
|
if (isDesktop())
|
||||||
return;
|
return;
|
||||||
|
@ -1026,9 +1026,16 @@ void Client::checkWorkspacePosition()
|
||||||
if (isDock())
|
if (isDock())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (maximizeMode() != MaximizeRestore)
|
if (maximizeMode() != MaximizeRestore) {
|
||||||
// TODO update geom_restore?
|
// TODO update geom_restore?
|
||||||
changeMaximize(false, false, true); // adjust size
|
changeMaximize(false, false, true); // adjust size
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quick_tile_mode != QuickTileNone) {
|
||||||
|
setGeometry(electricBorderMaximizeGeometry(geometry().center(), desktop()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isShade()) { // TODO
|
if (!isShade()) { // TODO
|
||||||
// this can be true only if this window was mapped before KWin
|
// this can be true only if this window was mapped before KWin
|
||||||
|
@ -1048,7 +1055,7 @@ void Client::checkWorkspacePosition()
|
||||||
int oldBottomMax = screenArea.y() + screenArea.height();
|
int oldBottomMax = screenArea.y() + screenArea.height();
|
||||||
int oldLeftMax = screenArea.x();
|
int oldLeftMax = screenArea.x();
|
||||||
int topMax = INT_MIN, rightMax = INT_MAX, bottomMax = INT_MAX, leftMax = INT_MIN;
|
int topMax = INT_MIN, rightMax = INT_MAX, bottomMax = INT_MAX, leftMax = INT_MIN;
|
||||||
QRect newGeom = geometry();
|
QRect newGeom = geo.isValid() ? geo : geometry();
|
||||||
const QRect& newGeomTall = QRect(newGeom.x(), 0, newGeom.width(), displayHeight()); // Full screen height
|
const QRect& newGeomTall = QRect(newGeom.x(), 0, newGeom.width(), displayHeight()); // Full screen height
|
||||||
const QRect& newGeomWide = QRect(0, newGeom.y(), displayWidth(), newGeom.height()); // Full screen width
|
const QRect& newGeomWide = QRect(0, newGeom.y(), displayWidth(), newGeom.height()); // Full screen width
|
||||||
|
|
||||||
|
@ -3077,8 +3084,8 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard)
|
||||||
if (mode == QuickTileNone || ((quick_tile_mode & QuickTileHorizontal) && (mode & QuickTileHorizontal))) {
|
if (mode == QuickTileNone || ((quick_tile_mode & QuickTileHorizontal) && (mode & QuickTileHorizontal))) {
|
||||||
// Untiling, so just restore geometry, and we're done.
|
// Untiling, so just restore geometry, and we're done.
|
||||||
setGeometry(geom_pretile);
|
setGeometry(geom_pretile);
|
||||||
checkWorkspacePosition(); // Just in case it's a different screen
|
|
||||||
quick_tile_mode = QuickTileNone;
|
quick_tile_mode = QuickTileNone;
|
||||||
|
checkWorkspacePosition(); // Just in case it's a different screen
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
QPoint whichScreen = keyboard ? geometry().center() : cursorPos();
|
QPoint whichScreen = keyboard ? geometry().center() : cursorPos();
|
||||||
|
|
Loading…
Reference in a new issue