diff --git a/kdecoration/oxygendecoration.cpp b/kdecoration/oxygendecoration.cpp --- a/kdecoration/oxygendecoration.cpp +++ b/kdecoration/oxygendecoration.cpp @@ -373,22 +373,28 @@ setBorders(QMargins(left, top, right, bottom)); - // extended sizes - const int extSize = s->largeSpacing(); - int extSides = 0; - int extBottom = 0; - if( hasNoBorders() ) - { - extSides = extSize; - extBottom = extSize; - - } else if( hasNoSideBorders() ) { - - extSides = extSize; - + // Specifies the extent of resizable area outside the client. + const int resizeExtent = s->largeSpacing(); + + // Typically decoration borders are used as resize handles, but if either + // one of them is missing (because user chose No Border size, for example), + // we need to set corresponding resize only border, otherwise the user + // won't be able to resize the client along the edge of the missing border. + // Even though shaded clients can't be resized, we still want to unset resize + // only borders in order to avoid the dead zone around the client. + QMargins resizeBorders; + if (!c->isShaded()) { + if (hasNoBorders()) { + resizeBorders.setLeft(isMaximizedHorizontally() || testFlag(Qt::LeftEdge) ? 0 : resizeExtent); + resizeBorders.setRight(isMaximizedHorizontally() || testFlag(Qt::RightEdge) ? 0 : resizeExtent); + resizeBorders.setBottom(isMaximizedVertically() || testFlag(Qt::BottomEdge) ? 0 : resizeExtent); + } else if (hasNoSideBorders()) { + resizeBorders.setLeft(isMaximizedHorizontally() || testFlag(Qt::LeftEdge) ? 0 : resizeExtent); + resizeBorders.setRight(isMaximizedHorizontally() || testFlag(Qt::RightEdge) ? 0 : resizeExtent); + } } - setResizeOnlyBorders(QMargins(extSides, 0, extSides, extBottom)); + setResizeOnlyBorders(resizeBorders); } //________________________________________________________________