Remove force geometry flags
With the client-side decoration changes, kwin will properly determine whether the window needs to be configured even if the frame geometry has not changed. This change slightly changes the semantics of the setFrameGeometry() method. Prior to this, it was possible to force a geometry, i.e. block other geometry updates, however such a behavior is counter-intuitive and it exponentially increases the complexity of code. As far as I know, the force flag was needed to propagate geometry changes if the frame geometry doesn't change, but the client geometry does. With the client-side decoration changes, the force flag is not needed, as kwin now takes into account the client geometry and the frame geometry when determining whether to send a configure event.
This commit is contained in:
parent
90d60a530f
commit
e5799a2131
8 changed files with 66 additions and 122 deletions
|
@ -871,9 +871,9 @@ void AbstractClient::blockGeometryUpdates(bool block)
|
|||
if (--m_blockGeometryUpdates == 0) {
|
||||
if (m_pendingGeometryUpdate != PendingGeometryNone) {
|
||||
if (isShade())
|
||||
setFrameGeometry(QRect(pos(), adjustedSize()), NormalGeometrySet);
|
||||
setFrameGeometry(QRect(pos(), adjustedSize()));
|
||||
else
|
||||
setFrameGeometry(frameGeometry(), NormalGeometrySet);
|
||||
setFrameGeometry(frameGeometry());
|
||||
m_pendingGeometryUpdate = PendingGeometryNone;
|
||||
}
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ void AbstractClient::setMaximize(bool vertically, bool horizontally)
|
|||
}
|
||||
}
|
||||
|
||||
void AbstractClient::move(int x, int y, ForceGeometry_t force)
|
||||
void AbstractClient::move(int x, int y)
|
||||
{
|
||||
// resuming geometry updates is handled only in setGeometry()
|
||||
Q_ASSERT(pendingGeometryUpdate() == PendingGeometryNone || areGeometryUpdatesBlocked());
|
||||
|
@ -908,16 +908,11 @@ void AbstractClient::move(int x, int y, ForceGeometry_t force)
|
|||
if (!areGeometryUpdatesBlocked() && p != rules()->checkPosition(p)) {
|
||||
qCDebug(KWIN_CORE) << "forced position fail:" << p << ":" << rules()->checkPosition(p);
|
||||
}
|
||||
if (force == NormalGeometrySet && m_frameGeometry.topLeft() == p)
|
||||
if (m_frameGeometry.topLeft() == p)
|
||||
return;
|
||||
m_frameGeometry.moveTopLeft(p);
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced)
|
||||
{} // maximum, nothing needed
|
||||
else if (force == ForceGeometrySet)
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
else
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
const QRect oldBufferGeometry = bufferGeometryBeforeUpdateBlocking();
|
||||
|
@ -3140,13 +3135,11 @@ void AbstractClient::setQuickTileMode(QuickTileMode mode, bool keyboard)
|
|||
if (maximizeMode() != MaximizeRestore) {
|
||||
|
||||
if (mode != QuickTileMode(QuickTileFlag::None)) {
|
||||
// decorations may turn off some borders when tiled
|
||||
const ForceGeometry_t geom_mode = isDecorated() ? ForceGeometrySet : NormalGeometrySet;
|
||||
m_quickTileMode = int(QuickTileFlag::None); // Temporary, so the maximize code doesn't get all confused
|
||||
|
||||
setMaximize(false, false);
|
||||
|
||||
setFrameGeometry(electricBorderMaximizeGeometry(keyboard ? frameGeometry().center() : Cursors::self()->mouse()->pos(), desktop()), geom_mode);
|
||||
setFrameGeometry(electricBorderMaximizeGeometry(keyboard ? frameGeometry().center() : Cursors::self()->mouse()->pos(), desktop()));
|
||||
// Store the mode change
|
||||
m_quickTileMode = mode;
|
||||
} else {
|
||||
|
@ -3213,11 +3206,9 @@ void AbstractClient::setQuickTileMode(QuickTileMode mode, bool keyboard)
|
|||
|
||||
if (mode != QuickTileMode(QuickTileFlag::None)) {
|
||||
m_quickTileMode = mode;
|
||||
// decorations may turn off some borders when tiled
|
||||
const ForceGeometry_t geom_mode = isDecorated() ? ForceGeometrySet : NormalGeometrySet;
|
||||
// Temporary, so the maximize code doesn't get all confused
|
||||
m_quickTileMode = int(QuickTileFlag::None);
|
||||
setFrameGeometry(electricBorderMaximizeGeometry(whichScreen, desktop()), geom_mode);
|
||||
setFrameGeometry(electricBorderMaximizeGeometry(whichScreen, desktop()));
|
||||
}
|
||||
|
||||
// Store the mode change
|
||||
|
@ -3229,9 +3220,7 @@ void AbstractClient::setQuickTileMode(QuickTileMode mode, bool keyboard)
|
|||
// Untiling, so just restore geometry, and we're done.
|
||||
if (!geometryRestore().isValid()) // invalid if we started maximized and wait for placement
|
||||
setGeometryRestore(frameGeometry());
|
||||
// decorations may turn off some borders when tiled
|
||||
const ForceGeometry_t geom_mode = isDecorated() ? ForceGeometrySet : NormalGeometrySet;
|
||||
setFrameGeometry(geometryRestore(), geom_mode);
|
||||
setFrameGeometry(geometryRestore());
|
||||
checkWorkspacePosition(); // Just in case it's a different screen
|
||||
}
|
||||
doSetQuickTileMode();
|
||||
|
|
|
@ -620,17 +620,13 @@ public:
|
|||
|
||||
void placeIn(const QRect &area);
|
||||
|
||||
enum ForceGeometry_t {
|
||||
NormalGeometrySet,
|
||||
ForceGeometrySet,
|
||||
};
|
||||
virtual void move(int x, int y, ForceGeometry_t force = NormalGeometrySet);
|
||||
void move(const QPoint &p, ForceGeometry_t force = NormalGeometrySet);
|
||||
virtual void resizeWithChecks(const QSize& s, ForceGeometry_t force = NormalGeometrySet) = 0;
|
||||
virtual void move(int x, int y);
|
||||
void move(const QPoint &p);
|
||||
virtual void resizeWithChecks(const QSize& s) = 0;
|
||||
void keepInArea(QRect area, bool partial = false);
|
||||
virtual QSize minSize() const;
|
||||
virtual QSize maxSize() const;
|
||||
virtual void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet) = 0;
|
||||
virtual void setFrameGeometry(const QRect &rect) = 0;
|
||||
|
||||
/**
|
||||
* How to resize the window in order to obey constraints (mainly aspect ratios).
|
||||
|
@ -1052,7 +1048,6 @@ protected:
|
|||
enum PendingGeometry_t {
|
||||
PendingGeometryNone,
|
||||
PendingGeometryNormal,
|
||||
PendingGeometryForced
|
||||
};
|
||||
PendingGeometry_t pendingGeometryUpdate() const;
|
||||
void setPendingGeometryUpdate(PendingGeometry_t update);
|
||||
|
@ -1354,9 +1349,9 @@ private:
|
|||
AbstractClient* cl;
|
||||
};
|
||||
|
||||
inline void AbstractClient::move(const QPoint& p, ForceGeometry_t force)
|
||||
inline void AbstractClient::move(const QPoint &p)
|
||||
{
|
||||
move(p.x(), p.y(), force);
|
||||
move(p.x(), p.y());
|
||||
}
|
||||
|
||||
inline const QList<AbstractClient*>& AbstractClient::transients() const
|
||||
|
|
|
@ -255,27 +255,20 @@ void InternalClient::hideClient(bool hide)
|
|||
Q_UNUSED(hide)
|
||||
}
|
||||
|
||||
void InternalClient::resizeWithChecks(const QSize &size, ForceGeometry_t force)
|
||||
void InternalClient::resizeWithChecks(const QSize &size)
|
||||
{
|
||||
Q_UNUSED(force)
|
||||
if (!m_internalWindow) {
|
||||
return;
|
||||
}
|
||||
const QRect area = workspace()->clientArea(WorkArea, this);
|
||||
setFrameGeometry(QRect{pos(), size.boundedTo(area.size())}, force);
|
||||
setFrameGeometry(QRect{pos(), size.boundedTo(area.size())});
|
||||
}
|
||||
|
||||
void InternalClient::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
||||
void InternalClient::setFrameGeometry(const QRect &rect)
|
||||
{
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
m_frameGeometry = rect;
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced) {
|
||||
// Maximum, nothing needed.
|
||||
} else if (force == ForceGeometrySet) {
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
} else {
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
}
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ public:
|
|||
bool isShown(bool shaded_is_shown) const override;
|
||||
bool isHiddenInternal() const override;
|
||||
void hideClient(bool hide) override;
|
||||
void resizeWithChecks(const QSize &size, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void resizeWithChecks(const QSize &size) override;
|
||||
void setFrameGeometry(const QRect &rect) override;
|
||||
AbstractClient *findModal(bool allow_itself = false) override;
|
||||
bool takeFocus() override;
|
||||
void setNoBorder(bool set) override;
|
||||
|
|
|
@ -96,7 +96,7 @@ AbstractClient *WaylandClient::findModal(bool allow_itself)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void WaylandClient::resizeWithChecks(const QSize &size, ForceGeometry_t force)
|
||||
void WaylandClient::resizeWithChecks(const QSize &size)
|
||||
{
|
||||
const QRect area = workspace()->clientArea(WorkArea, this);
|
||||
|
||||
|
@ -110,7 +110,7 @@ void WaylandClient::resizeWithChecks(const QSize &size, ForceGeometry_t force)
|
|||
if (height > area.height()) {
|
||||
height = area.height();
|
||||
}
|
||||
setFrameGeometry(QRect(x(), y(), width, height), force);
|
||||
setFrameGeometry(QRect(x(), y(), width, height));
|
||||
}
|
||||
|
||||
void WaylandClient::killWindow()
|
||||
|
@ -339,7 +339,7 @@ QSize WaylandClient::requestedClientSize() const
|
|||
return requestedClientGeometry().size();
|
||||
}
|
||||
|
||||
void WaylandClient::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
||||
void WaylandClient::setFrameGeometry(const QRect &rect)
|
||||
{
|
||||
m_requestedFrameGeometry = rect;
|
||||
|
||||
|
@ -356,14 +356,7 @@ void WaylandClient::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
|||
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
m_frameGeometry = m_requestedFrameGeometry;
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced) {
|
||||
return;
|
||||
}
|
||||
if (force == ForceGeometrySet) {
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
} else {
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
}
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -386,7 +379,7 @@ void WaylandClient::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
|||
updateGeometry(updateRect);
|
||||
}
|
||||
|
||||
void WaylandClient::move(int x, int y, ForceGeometry_t force)
|
||||
void WaylandClient::move(int x, int y)
|
||||
{
|
||||
Q_ASSERT(pendingGeometryUpdate() == PendingGeometryNone || areGeometryUpdatesBlocked());
|
||||
QPoint p(x, y);
|
||||
|
@ -395,19 +388,12 @@ void WaylandClient::move(int x, int y, ForceGeometry_t force)
|
|||
}
|
||||
m_requestedFrameGeometry.moveTopLeft(p);
|
||||
m_requestedClientGeometry.moveTopLeft(framePosToClientPos(p));
|
||||
if (force == NormalGeometrySet && m_frameGeometry.topLeft() == p) {
|
||||
if (m_frameGeometry.topLeft() == p) {
|
||||
return;
|
||||
}
|
||||
m_frameGeometry.moveTopLeft(m_requestedFrameGeometry.topLeft());
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced) {
|
||||
return;
|
||||
}
|
||||
if (force == ForceGeometrySet) {
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
} else {
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
}
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
const QRect oldBufferGeometry = bufferGeometryBeforeUpdateBlocking();
|
||||
|
|
|
@ -32,10 +32,10 @@ public:
|
|||
bool isLockScreen() const override;
|
||||
bool isLocalhost() const override;
|
||||
AbstractClient *findModal(bool allow_itself = false) override;
|
||||
void resizeWithChecks(const QSize &size, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void resizeWithChecks(const QSize &size) override;
|
||||
void setFrameGeometry(const QRect &rect) override;
|
||||
using AbstractClient::move;
|
||||
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void move(int x, int y) override;
|
||||
void killWindow() override;
|
||||
QByteArray windowRole() const override;
|
||||
bool isShown(bool shaded_is_shown) const override;
|
||||
|
|
|
@ -311,7 +311,6 @@ bool X11Client::manage(xcb_window_t w, bool isMapped)
|
|||
|
||||
// From this place on, manage() must not return false
|
||||
blockGeometryUpdates();
|
||||
setPendingGeometryUpdate(PendingGeometryForced); // Force update when finishing with geometry changes
|
||||
|
||||
embedClient(w, attr->visual, attr->colormap, windowGeometry->depth);
|
||||
|
||||
|
@ -1046,7 +1045,7 @@ void X11Client::createDecoration(const QRect& oldgeom)
|
|||
// move(calculateGravitation(true));
|
||||
// move(calculateGravitation(false));
|
||||
QRect oldgeom = frameGeometry();
|
||||
plainResize(adjustedSize(), ForceGeometrySet);
|
||||
plainResize(adjustedSize());
|
||||
if (!isShade())
|
||||
checkWorkspacePosition(oldgeom);
|
||||
emit geometryShapeChanged(this, oldgeom);
|
||||
|
@ -1060,7 +1059,7 @@ void X11Client::createDecoration(const QRect& oldgeom)
|
|||
setDecoration(decoration);
|
||||
|
||||
move(calculateGravitation(false));
|
||||
plainResize(adjustedSize(), ForceGeometrySet);
|
||||
plainResize(adjustedSize());
|
||||
updateDecorationInputShape();
|
||||
if (Compositor::compositing()) {
|
||||
discardWindowPixmap();
|
||||
|
@ -1074,7 +1073,7 @@ void X11Client::destroyDecoration()
|
|||
if (isDecorated()) {
|
||||
QPoint grav = calculateGravitation(true);
|
||||
AbstractClient::destroyDecoration();
|
||||
plainResize(adjustedSize(), ForceGeometrySet);
|
||||
plainResize(adjustedSize());
|
||||
move(grav);
|
||||
if (compositing())
|
||||
discardWindowPixmap();
|
||||
|
@ -2736,7 +2735,7 @@ void X11Client::handleSync()
|
|||
addRepaintFull();
|
||||
}
|
||||
|
||||
void X11Client::move(int x, int y, ForceGeometry_t force)
|
||||
void X11Client::move(int x, int y)
|
||||
{
|
||||
const QPoint framePosition(x, y);
|
||||
m_clientGeometry.moveTopLeft(framePosToClientPos(framePosition));
|
||||
|
@ -2747,18 +2746,12 @@ void X11Client::move(int x, int y, ForceGeometry_t force)
|
|||
qCDebug(KWIN_CORE) << "forced position fail:" << framePosition << ":" << rules()->checkPosition(framePosition);
|
||||
}
|
||||
m_frameGeometry.moveTopLeft(framePosition);
|
||||
if (force == NormalGeometrySet && m_bufferGeometry.topLeft() == bufferPosition) {
|
||||
if (m_bufferGeometry.topLeft() == bufferPosition) {
|
||||
return;
|
||||
}
|
||||
m_bufferGeometry.moveTopLeft(bufferPosition);
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced) {
|
||||
// Maximum, nothing needed.
|
||||
} else if (force == ForceGeometrySet) {
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
} else {
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
}
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
const QRect oldBufferGeometry = bufferGeometryBeforeUpdateBlocking();
|
||||
|
@ -3867,7 +3860,7 @@ void X11Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh,
|
|||
// Handling of the real ConfigureRequest event forces sending it, as there it's necessary.
|
||||
}
|
||||
|
||||
void X11Client::resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force)
|
||||
void X11Client::resizeWithChecks(int w, int h, xcb_gravity_t gravity)
|
||||
{
|
||||
Q_ASSERT(!shade_geometry_change);
|
||||
if (isShade()) {
|
||||
|
@ -3925,7 +3918,7 @@ void X11Client::resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeome
|
|||
newy = newy + height() - h;
|
||||
break;
|
||||
}
|
||||
setFrameGeometry(QRect{newx, newy, w, h}, force);
|
||||
setFrameGeometry(QRect{newx, newy, w, h});
|
||||
}
|
||||
|
||||
// _NET_MOVERESIZE_WINDOW
|
||||
|
@ -4008,7 +4001,7 @@ bool X11Client::isMaximizable() const
|
|||
/**
|
||||
* Reimplemented to inform the client about the new window position.
|
||||
*/
|
||||
void X11Client::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
||||
void X11Client::setFrameGeometry(const QRect &rect)
|
||||
{
|
||||
// this code is also duplicated in X11Client::plainResize()
|
||||
// Ok, the shading geometry stuff. Generally, code doesn't care about shaded geometry,
|
||||
|
@ -4041,17 +4034,12 @@ void X11Client::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
|||
qCDebug(KWIN_CORE) << "forced geometry fail:" << frameGeometry << ":" << rules()->checkGeometry(frameGeometry);
|
||||
}
|
||||
m_frameGeometry = frameGeometry;
|
||||
if (force == NormalGeometrySet && m_bufferGeometry == bufferGeometry && pendingGeometryUpdate() == PendingGeometryNone) {
|
||||
if (m_bufferGeometry == bufferGeometry && pendingGeometryUpdate() == PendingGeometryNone) {
|
||||
return;
|
||||
}
|
||||
m_bufferGeometry = bufferGeometry;
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced)
|
||||
{} // maximum, nothing needed
|
||||
else if (force == ForceGeometrySet)
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
else
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4080,7 +4068,7 @@ void X11Client::setFrameGeometry(const QRect &rect, ForceGeometry_t force)
|
|||
emit geometryShapeChanged(this, oldFrameGeometry);
|
||||
}
|
||||
|
||||
void X11Client::plainResize(int w, int h, ForceGeometry_t force)
|
||||
void X11Client::plainResize(int w, int h)
|
||||
{
|
||||
QSize frameSize(w, h);
|
||||
QSize bufferSize;
|
||||
|
@ -4109,17 +4097,12 @@ void X11Client::plainResize(int w, int h, ForceGeometry_t force)
|
|||
m_frameGeometry.setSize(frameSize);
|
||||
// resuming geometry updates is handled only in setGeometry()
|
||||
Q_ASSERT(pendingGeometryUpdate() == PendingGeometryNone || areGeometryUpdatesBlocked());
|
||||
if (force == NormalGeometrySet && m_bufferGeometry.size() == bufferSize) {
|
||||
if (m_bufferGeometry.size() == bufferSize) {
|
||||
return;
|
||||
}
|
||||
m_bufferGeometry.setSize(bufferSize);
|
||||
if (areGeometryUpdatesBlocked()) {
|
||||
if (pendingGeometryUpdate() == PendingGeometryForced)
|
||||
{} // maximum, nothing needed
|
||||
else if (force == ForceGeometrySet)
|
||||
setPendingGeometryUpdate(PendingGeometryForced);
|
||||
else
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
setPendingGeometryUpdate(PendingGeometryNormal);
|
||||
return;
|
||||
}
|
||||
const QRect oldBufferGeometry = bufferGeometryBeforeUpdateBlocking();
|
||||
|
@ -4146,7 +4129,7 @@ void X11Client::updateServerGeometry()
|
|||
{
|
||||
const QRect oldBufferGeometry = bufferGeometryBeforeUpdateBlocking();
|
||||
|
||||
if (oldBufferGeometry.size() != m_bufferGeometry.size() || pendingGeometryUpdate() == PendingGeometryForced) {
|
||||
if (oldBufferGeometry.size() != m_bufferGeometry.size()) {
|
||||
resizeDecoration();
|
||||
// If the client is being interactively resized, then the frame window, the wrapper window,
|
||||
// and the client window have correct geometry at this point, so we don't have to configure
|
||||
|
@ -4285,8 +4268,6 @@ void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust)
|
|||
changeMaximizeRecursion = false;
|
||||
}
|
||||
|
||||
const ForceGeometry_t geom_mode = isDecorated() ? ForceGeometrySet : NormalGeometrySet;
|
||||
|
||||
// Conditional quick tiling exit points
|
||||
if (quickTileMode() != QuickTileMode(QuickTileFlag::None)) {
|
||||
if (old_mode == MaximizeFull &&
|
||||
|
@ -4307,17 +4288,17 @@ void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust)
|
|||
if (old_mode & MaximizeHorizontal) { // actually restoring from MaximizeFull
|
||||
if (geometryRestore().width() == 0 || !clientArea.contains(geometryRestore().center())) {
|
||||
// needs placement
|
||||
plainResize(constrainFrameSize(QSize(width() * 2 / 3, clientArea.height()), SizeModeFixedH), geom_mode);
|
||||
plainResize(constrainFrameSize(QSize(width() * 2 / 3, clientArea.height()), SizeModeFixedH));
|
||||
Placement::self()->placeSmart(this, clientArea);
|
||||
} else {
|
||||
setFrameGeometry(QRect(QPoint(geometryRestore().x(), clientArea.top()),
|
||||
constrainFrameSize(QSize(geometryRestore().width(), clientArea.height()), SizeModeFixedH)), geom_mode);
|
||||
constrainFrameSize(QSize(geometryRestore().width(), clientArea.height()), SizeModeFixedH)));
|
||||
}
|
||||
} else {
|
||||
QRect r(x(), clientArea.top(), width(), clientArea.height());
|
||||
r.setTopLeft(rules()->checkPosition(r.topLeft()));
|
||||
r.setSize(constrainFrameSize(r.size(), SizeModeFixedH));
|
||||
setFrameGeometry(r, geom_mode);
|
||||
setFrameGeometry(r);
|
||||
}
|
||||
info->setState(NET::MaxVert, NET::Max);
|
||||
break;
|
||||
|
@ -4327,17 +4308,17 @@ void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust)
|
|||
if (old_mode & MaximizeVertical) { // actually restoring from MaximizeFull
|
||||
if (geometryRestore().height() == 0 || !clientArea.contains(geometryRestore().center())) {
|
||||
// needs placement
|
||||
plainResize(constrainFrameSize(QSize(clientArea.width(), height() * 2 / 3), SizeModeFixedW), geom_mode);
|
||||
plainResize(constrainFrameSize(QSize(clientArea.width(), height() * 2 / 3), SizeModeFixedW));
|
||||
Placement::self()->placeSmart(this, clientArea);
|
||||
} else {
|
||||
setFrameGeometry(QRect(QPoint(clientArea.left(), geometryRestore().y()),
|
||||
constrainFrameSize(QSize(clientArea.width(), geometryRestore().height()), SizeModeFixedW)), geom_mode);
|
||||
constrainFrameSize(QSize(clientArea.width(), geometryRestore().height()), SizeModeFixedW)));
|
||||
}
|
||||
} else {
|
||||
QRect r(clientArea.left(), y(), clientArea.width(), height());
|
||||
r.setTopLeft(rules()->checkPosition(r.topLeft()));
|
||||
r.setSize(constrainFrameSize(r.size(), SizeModeFixedW));
|
||||
setFrameGeometry(r, geom_mode);
|
||||
setFrameGeometry(r);
|
||||
}
|
||||
info->setState(NET::MaxHoriz, NET::Max);
|
||||
break;
|
||||
|
@ -4376,7 +4357,7 @@ void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust)
|
|||
if (m_geometryHints.hasAspect()) {
|
||||
restore.setSize(constrainFrameSize(restore.size(), SizeModeAny));
|
||||
}
|
||||
setFrameGeometry(restore, geom_mode);
|
||||
setFrameGeometry(restore);
|
||||
if (!clientArea.contains(geometryRestore().center())) { // Not restoring to the same screen
|
||||
Placement::self()->place(this, clientArea);
|
||||
}
|
||||
|
@ -4427,7 +4408,7 @@ void X11Client::changeMaximize(bool horizontal, bool vertical, bool adjust)
|
|||
}
|
||||
r.moveTopLeft(rules()->checkPosition(r.topLeft()));
|
||||
}
|
||||
setFrameGeometry(r, geom_mode);
|
||||
setFrameGeometry(r);
|
||||
if (options->electricBorderMaximize() && r.top() == clientArea.top())
|
||||
updateQuickTileMode(QuickTileFlag::Maximize);
|
||||
else
|
||||
|
|
|
@ -167,15 +167,15 @@ public:
|
|||
void updateShape();
|
||||
|
||||
using AbstractClient::move;
|
||||
void move(int x, int y, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void move(int x, int y) override;
|
||||
void setFrameGeometry(const QRect &rect) override;
|
||||
/// plainResize() simply resizes
|
||||
void plainResize(int w, int h, ForceGeometry_t force = NormalGeometrySet);
|
||||
void plainResize(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
|
||||
void plainResize(int w, int h);
|
||||
void plainResize(const QSize& s);
|
||||
/// resizeWithChecks() resizes according to gravity, and checks workarea position
|
||||
void resizeWithChecks(const QSize &size, ForceGeometry_t force = NormalGeometrySet) override;
|
||||
void resizeWithChecks(int w, int h, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
|
||||
void resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force = NormalGeometrySet);
|
||||
void resizeWithChecks(const QSize &size) override;
|
||||
void resizeWithChecks(int w, int h, xcb_gravity_t gravity);
|
||||
void resizeWithChecks(const QSize& s, xcb_gravity_t gravity);
|
||||
QSize constrainClientSize(const QSize &size, SizeMode mode = SizeModeAny) const override;
|
||||
|
||||
bool providesContextHelp() const override;
|
||||
|
@ -588,19 +588,19 @@ inline bool X11Client::isManaged() const
|
|||
return m_managed;
|
||||
}
|
||||
|
||||
inline void X11Client::plainResize(const QSize& s, ForceGeometry_t force)
|
||||
inline void X11Client::plainResize(const QSize& s)
|
||||
{
|
||||
plainResize(s.width(), s.height(), force);
|
||||
plainResize(s.width(), s.height());
|
||||
}
|
||||
|
||||
inline void X11Client::resizeWithChecks(const QSize &s, AbstractClient::ForceGeometry_t force)
|
||||
inline void X11Client::resizeWithChecks(const QSize &s)
|
||||
{
|
||||
resizeWithChecks(s.width(), s.height(), XCB_GRAVITY_BIT_FORGET, force);
|
||||
resizeWithChecks(s.width(), s.height(), XCB_GRAVITY_BIT_FORGET);
|
||||
}
|
||||
|
||||
inline void X11Client::resizeWithChecks(const QSize& s, xcb_gravity_t gravity, ForceGeometry_t force)
|
||||
inline void X11Client::resizeWithChecks(const QSize& s, xcb_gravity_t gravity)
|
||||
{
|
||||
resizeWithChecks(s.width(), s.height(), gravity, force);
|
||||
resizeWithChecks(s.width(), s.height(), gravity);
|
||||
}
|
||||
|
||||
inline bool X11Client::hasUserTimeSupport() const
|
||||
|
|
Loading…
Reference in a new issue