React on border size changes of the Decoration
This replaces the checkBorderSizes. Maybe the most dangerous change in the scope of introducing the new Decorations.
This commit is contained in:
parent
0151b224e3
commit
750f61fa55
2 changed files with 11 additions and 40 deletions
50
client.cpp
50
client.cpp
|
@ -536,6 +536,17 @@ void Client::createDecoration(const QRect& oldgeom)
|
|||
}
|
||||
);
|
||||
connect(m_decoration, &KDecoration2::Decoration::extendedBordersChanged, this, &Client::updateInputWindow);
|
||||
connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this,
|
||||
[this]() {
|
||||
GeometryUpdatesBlocker blocker(this);
|
||||
move(calculateGravitation(true));
|
||||
move(calculateGravitation(false));
|
||||
QRect oldgeom = geometry();
|
||||
plainResize(sizeForClientSize(clientSize()), ForceGeometrySet);
|
||||
checkWorkspacePosition(oldgeom);
|
||||
emit geometryShapeChanged(this, oldgeom);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
move(calculateGravitation(false));
|
||||
|
@ -564,45 +575,6 @@ void Client::destroyDecoration()
|
|||
m_decoInputExtent.reset();
|
||||
}
|
||||
|
||||
bool Client::checkBorderSizes(bool also_resize)
|
||||
{
|
||||
#if 0
|
||||
if (decoration == NULL)
|
||||
return false;
|
||||
|
||||
int new_left = 0, new_right = 0, new_top = 0, new_bottom = 0;
|
||||
decoration->padding(new_left, new_right, new_top, new_bottom);
|
||||
if (padding_left != new_left || padding_top != new_top)
|
||||
Xcb::moveWindow(decoration->window()->winId(), -new_left, -new_top);
|
||||
padding_left = new_left;
|
||||
padding_right = new_right;
|
||||
padding_top = new_top;
|
||||
padding_bottom = new_bottom;
|
||||
decoration->borders(new_left, new_right, new_top, new_bottom);
|
||||
if (new_left == border_left && new_right == border_right &&
|
||||
new_top == border_top && new_bottom == border_bottom)
|
||||
return false;
|
||||
if (!also_resize) {
|
||||
border_left = new_left;
|
||||
border_right = new_right;
|
||||
border_top = new_top;
|
||||
border_bottom = new_bottom;
|
||||
return true;
|
||||
}
|
||||
GeometryUpdatesBlocker blocker(this);
|
||||
move(calculateGravitation(true));
|
||||
border_left = new_left;
|
||||
border_right = new_right;
|
||||
border_top = new_top;
|
||||
border_bottom = new_bottom;
|
||||
move(calculateGravitation(false));
|
||||
QRect oldgeom = geometry();
|
||||
plainResize(sizeForClientSize(clientSize()), ForceGeometrySet);
|
||||
checkWorkspacePosition(oldgeom);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void Client::triggerDecorationRepaint()
|
||||
{
|
||||
if (m_decoration) {
|
||||
|
|
1
client.h
1
client.h
|
@ -444,7 +444,6 @@ public:
|
|||
void demandAttention(bool set = true);
|
||||
|
||||
void updateDecoration(bool check_workspace_pos, bool force = false);
|
||||
bool checkBorderSizes(bool also_resize);
|
||||
void triggerDecorationRepaint();
|
||||
|
||||
void updateShape();
|
||||
|
|
Loading…
Reference in a new issue