diff --git a/src/effects/magiclamp/magiclamp.cpp b/src/effects/magiclamp/magiclamp.cpp index 859e6968c1..55291d3b24 100644 --- a/src/effects/magiclamp/magiclamp.cpp +++ b/src/effects/magiclamp/magiclamp.cpp @@ -222,8 +222,8 @@ void MagicLampEffect::apply(EffectWindow *w, int mask, WindowPaintData &data, Wi offset[0] = (icon.y() + quad[0].y() - geo.y()) * progress * ((quadFactor * quadFactor * quadFactor) / height_cube); quadFactor = quad[2].y() + (geo.height() - quad[2].y()) * progress; offset[1] = (icon.y() + quad[2].y() - geo.y()) * progress * ((quadFactor * quadFactor * quadFactor) / height_cube); - p_progress[1] = qMin(offset[1] / (icon.y() + icon.height() - geo.y() - float(quad[2].y())), 1.0f); - p_progress[0] = qMin(offset[0] / (icon.y() + icon.height() - geo.y() - float(quad[0].y())), 1.0f); + p_progress[1] = std::min(offset[1] / (icon.y() + icon.height() - geo.y() - float(quad[2].y())), 1.0f); + p_progress[0] = std::min(offset[0] / (icon.y() + icon.height() - geo.y() - float(quad[0].y())), 1.0f); } else { lastQuad = quad; } @@ -241,8 +241,8 @@ void MagicLampEffect::apply(EffectWindow *w, int mask, WindowPaintData &data, Wi offset[0] = (geo.y() - icon.height() + geo.height() + quad[0].y() - icon.y()) * progress * ((quadFactor * quadFactor * quadFactor) / height_cube); quadFactor = geo.height() - quad[2].y() + (quad[2].y()) * progress; offset[1] = (geo.y() - icon.height() + geo.height() + quad[2].y() - icon.y()) * progress * ((quadFactor * quadFactor * quadFactor) / height_cube); - p_progress[0] = qMin(offset[0] / (geo.y() - icon.height() + geo.height() - icon.y() - float(geo.height() - quad[0].y())), 1.0f); - p_progress[1] = qMin(offset[1] / (geo.y() - icon.height() + geo.height() - icon.y() - float(geo.height() - quad[2].y())), 1.0f); + p_progress[0] = std::min(offset[0] / (geo.y() - icon.height() + geo.height() - icon.y() - float(geo.height() - quad[0].y())), 1.0f); + p_progress[1] = std::min(offset[1] / (geo.y() - icon.height() + geo.height() - icon.y() - float(geo.height() - quad[2].y())), 1.0f); } else { lastQuad = quad; } @@ -263,8 +263,8 @@ void MagicLampEffect::apply(EffectWindow *w, int mask, WindowPaintData &data, Wi offset[0] = (geo.x() - icon.width() + geo.width() + quad[0].x() - icon.x()) * progress * ((quadFactor * quadFactor * quadFactor) / width_cube); quadFactor = geo.width() - quad[1].x() + (quad[1].x()) * progress; offset[1] = (geo.x() - icon.width() + geo.width() + quad[1].x() - icon.x()) * progress * ((quadFactor * quadFactor * quadFactor) / width_cube); - p_progress[0] = qMin(offset[0] / (geo.x() - icon.width() + geo.width() - icon.x() - float(geo.width() - quad[0].x())), 1.0f); - p_progress[1] = qMin(offset[1] / (geo.x() - icon.width() + geo.width() - icon.x() - float(geo.width() - quad[1].x())), 1.0f); + p_progress[0] = std::min(offset[0] / (geo.x() - icon.width() + geo.width() - icon.x() - float(geo.width() - quad[0].x())), 1.0f); + p_progress[1] = std::min(offset[1] / (geo.x() - icon.width() + geo.width() - icon.x() - float(geo.width() - quad[1].x())), 1.0f); } else { lastQuad = quad; } @@ -285,8 +285,8 @@ void MagicLampEffect::apply(EffectWindow *w, int mask, WindowPaintData &data, Wi offset[0] = (icon.x() + quad[0].x() - geo.x()) * progress * ((quadFactor * quadFactor * quadFactor) / width_cube); quadFactor = quad[1].x() + (geo.width() - quad[1].x()) * progress; offset[1] = (icon.x() + quad[1].x() - geo.x()) * progress * ((quadFactor * quadFactor * quadFactor) / width_cube); - p_progress[0] = qMin(offset[0] / (icon.x() + icon.width() - geo.x() - float(quad[0].x())), 1.0f); - p_progress[1] = qMin(offset[1] / (icon.x() + icon.width() - geo.x() - float(quad[1].x())), 1.0f); + p_progress[0] = std::min(offset[0] / (icon.x() + icon.width() - geo.x() - float(quad[0].x())), 1.0f); + p_progress[1] = std::min(offset[1] / (icon.x() + icon.width() - geo.x() - float(quad[1].x())), 1.0f); } else { lastQuad = quad; } diff --git a/src/effects/magnifier/magnifier.cpp b/src/effects/magnifier/magnifier.cpp index a38acdc307..906b9bb97b 100644 --- a/src/effects/magnifier/magnifier.cpp +++ b/src/effects/magnifier/magnifier.cpp @@ -86,9 +86,9 @@ void MagnifierEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::mill if (m_zoom != m_targetZoom) { double diff = time / animationTime(500.0); if (m_targetZoom > m_zoom) { - m_zoom = qMin(m_zoom * std::max(1 + diff, 1.2), m_targetZoom); + m_zoom = std::min(m_zoom * std::max(1 + diff, 1.2), m_targetZoom); } else { - m_zoom = std::max(m_zoom * qMin(1 - diff, 0.8), m_targetZoom); + m_zoom = std::max(m_zoom * std::min(1 - diff, 0.8), m_targetZoom); if (m_zoom == 1.0) { // zoom ended - delete FBO and texture m_fbo.reset(); diff --git a/src/effects/mousemark/mousemark.cpp b/src/effects/mousemark/mousemark.cpp index a8a175602f..a64d1abe5a 100644 --- a/src/effects/mousemark/mousemark.cpp +++ b/src/effects/mousemark/mousemark.cpp @@ -163,7 +163,7 @@ void MouseMarkEffect::slotMouseChanged(const QPoint &pos, const QPoint &, } QPoint pos2 = drawing.last(); drawing.append(pos); - QRect repaint = QRect(qMin(pos.x(), pos2.x()), qMin(pos.y(), pos2.y()), + QRect repaint = QRect(std::min(pos.x(), pos2.x()), std::min(pos.y(), pos2.y()), std::max(pos.x(), pos2.x()), std::max(pos.y(), pos2.y())); repaint.adjust(-width, -width, width, width); effects->addRepaint(repaint); diff --git a/src/effects/screenshot/screenshotdbusinterface1.cpp b/src/effects/screenshot/screenshotdbusinterface1.cpp index f3294337f3..dce7ce89df 100644 --- a/src/effects/screenshot/screenshotdbusinterface1.cpp +++ b/src/effects/screenshot/screenshotdbusinterface1.cpp @@ -428,11 +428,11 @@ static xcb_pixmap_t xpixmapFromImage(const QImage &image) const QSize window = pickWindowSize(image); for (int i = 0; i < image.height(); i += window.height()) { - const int targetHeight = qMin(image.height() - i, window.height()); + const int targetHeight = std::min(image.height() - i, window.height()); const uint8_t *line = image.scanLine(i); for (int j = 0; j < image.width(); j += window.width()) { - const int targetWidth = qMin(image.width() - j, window.width()); + const int targetWidth = std::min(image.width() - j, window.width()); const uint8_t *bytes = line + j * bytesPerPixel; const uint32_t byteCount = targetWidth * targetHeight * bytesPerPixel; diff --git a/src/effects/slidingpopups/slidingpopups.cpp b/src/effects/slidingpopups/slidingpopups.cpp index a7ec168dae..50233f54d7 100644 --- a/src/effects/slidingpopups/slidingpopups.cpp +++ b/src/effects/slidingpopups/slidingpopups.cpp @@ -149,7 +149,7 @@ void SlidingPopupsEffect::paintWindow(EffectWindow *w, int mask, QRegion region, if (slideLength < geo.width()) { data.multiplyOpacity(t); } - data.translate(-interpolate(qMin(geo.width(), slideLength), 0.0, t)); + data.translate(-interpolate(std::min(geo.width(), slideLength), 0.0, t)); splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - animData.offset); region &= QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height()); break; @@ -157,7 +157,7 @@ void SlidingPopupsEffect::paintWindow(EffectWindow *w, int mask, QRegion region, if (slideLength < geo.height()) { data.multiplyOpacity(t); } - data.translate(0.0, -interpolate(qMin(geo.height(), slideLength), 0.0, t)); + data.translate(0.0, -interpolate(std::min(geo.height(), slideLength), 0.0, t)); splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - animData.offset); region &= QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint); break; @@ -165,7 +165,7 @@ void SlidingPopupsEffect::paintWindow(EffectWindow *w, int mask, QRegion region, if (slideLength < geo.width()) { data.multiplyOpacity(t); } - data.translate(interpolate(qMin(geo.width(), slideLength), 0.0, t)); + data.translate(interpolate(std::min(geo.width(), slideLength), 0.0, t)); splitPoint = screenRect.x() + screenRect.width() - geo.x() - animData.offset; region &= QRegion(geo.x(), geo.y(), splitPoint, geo.height()); break; @@ -174,7 +174,7 @@ void SlidingPopupsEffect::paintWindow(EffectWindow *w, int mask, QRegion region, if (slideLength < geo.height()) { data.multiplyOpacity(t); } - data.translate(0.0, interpolate(qMin(geo.height(), slideLength), 0.0, t)); + data.translate(0.0, interpolate(std::min(geo.height(), slideLength), 0.0, t)); splitPoint = screenRect.y() + screenRect.height() - geo.y() - animData.offset; region &= QRegion(geo.x(), geo.y(), geo.width(), splitPoint); } diff --git a/src/effects/thumbnailaside/thumbnailaside.cpp b/src/effects/thumbnailaside/thumbnailaside.cpp index 99960be123..8c6b137b48 100644 --- a/src/effects/thumbnailaside/thumbnailaside.cpp +++ b/src/effects/thumbnailaside/thumbnailaside.cpp @@ -160,7 +160,7 @@ void ThumbnailAsideEffect::arrange() } QRectF area = effects->clientArea(MaximizeArea, effectiveScreen, effects->currentDesktop()); double scale = area.height() / double(height); - scale = qMin(scale, maxwidth / double(mwidth)); // don't be wider than maxwidth pixels + scale = std::min(scale, maxwidth / double(mwidth)); // don't be wider than maxwidth pixels int add = 0; for (int i = 0; i < windows.size(); diff --git a/src/effects/wobblywindows/wobblywindows.cpp b/src/effects/wobblywindows/wobblywindows.cpp index 352143dbc2..4da51253c8 100644 --- a/src/effects/wobblywindows/wobblywindows.cpp +++ b/src/effects/wobblywindows/wobblywindows.cpp @@ -283,8 +283,8 @@ void WobblyWindowsEffect::apply(EffectWindow *w, int mask, WindowPaintData &data Pair newPos = computeBezierPoint(wwi, uv); v.move(newPos.x - tx, newPos.y - ty); } - left = qMin(left, quads[i].left()); - top = qMin(top, quads[i].top()); + left = std::min(left, quads[i].left()); + top = std::min(top, quads[i].top()); right = std::max(right, quads[i].right()); bottom = std::max(bottom, quads[i].bottom()); } diff --git a/src/effects/zoom/zoom.cpp b/src/effects/zoom/zoom.cpp index 5cfe73c7f8..d14b08ba5c 100644 --- a/src/effects/zoom/zoom.cpp +++ b/src/effects/zoom/zoom.cpp @@ -237,7 +237,7 @@ void ZoomEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseco const float zoomDist = qAbs(target_zoom - source_zoom); if (target_zoom > zoom) { - zoom = qMin(zoom + ((zoomDist * time) / animationTime(150 * zoomFactor)), target_zoom); + zoom = std::min(zoom + ((zoomDist * time) / animationTime(150 * zoomFactor)), target_zoom); } else { zoom = std::max(zoom - ((zoomDist * time) / animationTime(150 * zoomFactor)), target_zoom); } @@ -319,8 +319,8 @@ void ZoomEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &d prevPoint = cursorPoint; // fall through case MouseTrackingDisabled: - xTranslation = qMin(0, std::max(int(screenSize.width() - screenSize.width() * zoom), int(screenSize.width() / 2 - prevPoint.x() * zoom))); - yTranslation = qMin(0, std::max(int(screenSize.height() - screenSize.height() * zoom), int(screenSize.height() / 2 - prevPoint.y() * zoom))); + xTranslation = std::min(0, std::max(int(screenSize.width() - screenSize.width() * zoom), int(screenSize.width() / 2 - prevPoint.x() * zoom))); + yTranslation = std::min(0, std::max(int(screenSize.height() - screenSize.height() * zoom), int(screenSize.height() / 2 - prevPoint.y() * zoom))); break; case MouseTrackingPush: { // touching an edge of the screen moves the zoom-area in that direction. @@ -339,10 +339,10 @@ void ZoomEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &d yMove = (y + threshold - screenSize.height()) / zoom; } if (xMove) { - prevPoint.setX(std::max(0, qMin(screenSize.width(), prevPoint.x() + xMove))); + prevPoint.setX(std::max(0, std::min(screenSize.width(), prevPoint.x() + xMove))); } if (yMove) { - prevPoint.setY(std::max(0, qMin(screenSize.height(), prevPoint.y() + yMove))); + prevPoint.setY(std::max(0, std::min(screenSize.height(), prevPoint.y() + yMove))); } xTranslation = -int(prevPoint.x() * (zoom - 1.0)); yTranslation = -int(prevPoint.y() * (zoom - 1.0)); @@ -478,8 +478,8 @@ void ZoomEffect::actualSize() void ZoomEffect::timelineFrameChanged(int /* frame */) { const QSize screenSize = effects->virtualScreenSize(); - prevPoint.setX(std::max(0, qMin(screenSize.width(), prevPoint.x() + xMove))); - prevPoint.setY(std::max(0, qMin(screenSize.height(), prevPoint.y() + yMove))); + prevPoint.setX(std::max(0, std::min(screenSize.width(), prevPoint.x() + xMove))); + prevPoint.setY(std::max(0, std::min(screenSize.height(), prevPoint.y() + yMove))); cursorPoint = prevPoint; effects->addRepaintFull(); } diff --git a/src/libkwineffects/kwineffects.cpp b/src/libkwineffects/kwineffects.cpp index c1b6977d65..aa02934480 100644 --- a/src/libkwineffects/kwineffects.cpp +++ b/src/libkwineffects/kwineffects.cpp @@ -938,9 +938,9 @@ WindowQuadList WindowQuadList::makeGrid(int maxQuadSize) const double bottom = first().bottom(); for (const WindowQuad &quad : std::as_const(*this)) { - left = qMin(left, quad.left()); + left = std::min(left, quad.left()); right = std::max(right, quad.right()); - top = qMin(top, quad.top()); + top = std::min(top, quad.top()); bottom = std::max(bottom, quad.bottom()); } @@ -965,11 +965,11 @@ WindowQuadList WindowQuadList::makeGrid(int maxQuadSize) const // Loop over all intersecting cells and add sub-quads for (double y = yBegin; y < quadBottom; y += maxQuadSize) { const double y0 = std::max(y, quadTop); - const double y1 = qMin(quadBottom, y + maxQuadSize); + const double y1 = std::min(quadBottom, y + maxQuadSize); for (double x = xBegin; x < quadRight; x += maxQuadSize) { const double x0 = std::max(x, quadLeft); - const double x1 = qMin(quadRight, x + maxQuadSize); + const double x1 = std::min(quadRight, x + maxQuadSize); ret.append(quad.makeSubQuad(x0, y0, x1, y1)); } @@ -992,9 +992,9 @@ WindowQuadList WindowQuadList::makeRegularGrid(int xSubdivisions, int ySubdivisi double bottom = first().bottom(); for (const WindowQuad &quad : *this) { - left = qMin(left, quad.left()); + left = std::min(left, quad.left()); right = std::max(right, quad.right()); - top = qMin(top, quad.top()); + top = std::min(top, quad.top()); bottom = std::max(bottom, quad.bottom()); } @@ -1022,11 +1022,11 @@ WindowQuadList WindowQuadList::makeRegularGrid(int xSubdivisions, int ySubdivisi // Loop over all intersecting cells and add sub-quads for (double y = yBegin; y < quadBottom; y += yIncrement) { const double y0 = std::max(y, quadTop); - const double y1 = qMin(quadBottom, y + yIncrement); + const double y1 = std::min(quadBottom, y + yIncrement); for (double x = xBegin; x < quadRight; x += xIncrement) { const double x0 = std::max(x, quadLeft); - const double x1 = qMin(quadRight, x + xIncrement); + const double x1 = std::min(quadRight, x + xIncrement); ret.append(quad.makeSubQuad(x0, y0, x1, y1)); } diff --git a/src/libkwineffects/kwineffects.h b/src/libkwineffects/kwineffects.h index a210071d73..41db02dced 100644 --- a/src/libkwineffects/kwineffects.h +++ b/src/libkwineffects/kwineffects.h @@ -4141,7 +4141,7 @@ inline const WindowVertex &WindowQuad::operator[](int index) const inline double WindowQuad::left() const { - return qMin(verts[0].px, qMin(verts[1].px, qMin(verts[2].px, verts[3].px))); + return std::min(verts[0].px, std::min(verts[1].px, std::min(verts[2].px, verts[3].px))); } inline double WindowQuad::right() const @@ -4151,7 +4151,7 @@ inline double WindowQuad::right() const inline double WindowQuad::top() const { - return qMin(verts[0].py, qMin(verts[1].py, qMin(verts[2].py, verts[3].py))); + return std::min(verts[0].py, std::min(verts[1].py, std::min(verts[2].py, verts[3].py))); } inline double WindowQuad::bottom() const diff --git a/src/options.cpp b/src/options.cpp index 4b85929ac8..1656f7aa0a 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -306,7 +306,7 @@ void Options::setFocusStealingPreventionLevel(int focusStealingPreventionLevel) if (m_focusStealingPreventionLevel == focusStealingPreventionLevel) { return; } - m_focusStealingPreventionLevel = std::max(0, qMin(4, focusStealingPreventionLevel)); + m_focusStealingPreventionLevel = std::max(0, std::min(4, focusStealingPreventionLevel)); Q_EMIT focusStealingPreventionLevelChanged(); } diff --git a/src/placement.cpp b/src/placement.cpp index 3fcf65a566..c86ecaf652 100644 --- a/src/placement.cpp +++ b/src/placement.cpp @@ -236,9 +236,9 @@ void Placement::placeSmart(Window *c, const QRectF &area, PlacementPolicy /*next // if windows overlap, calc the overall overlapping if ((cxl < xr) && (cxr > xl) && (cyt < yb) && (cyb > yt)) { xl = std::max(cxl, xl); - xr = qMin(cxr, xr); + xr = std::min(cxr, xr); yt = std::max(cyt, yt); - yb = qMin(cyb, yb); + yb = std::min(cyb, yb); if (client->keepAbove()) { overlap += 16 * (xr - xl) * (yb - yt); } else if (client->keepBelow() && !client->isDock()) { // ignore KeepBelow windows diff --git a/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp b/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp index f8ed63eb37..2e296a05ac 100644 --- a/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp +++ b/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp @@ -23,7 +23,7 @@ PlastikButtonProvider::PlastikButtonProvider() QPixmap PlastikButtonProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) { - int origSize = requestedSize.isValid() ? qMin(requestedSize.width(), requestedSize.height()) : 10; + int origSize = requestedSize.isValid() ? std::min(requestedSize.width(), requestedSize.height()) : 10; if (size) { *size = QSize(origSize, origSize); } diff --git a/src/plugins/nightcolor/nightcolormanager.cpp b/src/plugins/nightcolor/nightcolormanager.cpp index ef18dff3b2..aeee503db3 100644 --- a/src/plugins/nightcolor/nightcolormanager.cpp +++ b/src/plugins/nightcolor/nightcolormanager.cpp @@ -287,7 +287,7 @@ void NightColorManager::readConfig() QTime evB = QTime::fromString(s->eveningBeginFixed(), "hhmm"); int diffME = evB > mrB ? mrB.msecsTo(evB) : evB.msecsTo(mrB); - int diffMin = qMin(diffME, MSC_DAY - diffME); + int diffMin = std::min(diffME, MSC_DAY - diffME); int trTime = s->transitionTime() * 1000 * 60; if (trTime < 0 || diffMin <= trTime) { @@ -353,7 +353,7 @@ void NightColorManager::quickAdjust(int targetTemp) int nextTemp; if (m_currentTemp < targetTemp) { - nextTemp = qMin(m_currentTemp + TEMPERATURE_STEP, targetTemp); + nextTemp = std::min(m_currentTemp + TEMPERATURE_STEP, targetTemp); } else { nextTemp = std::max(m_currentTemp - TEMPERATURE_STEP, targetTemp); } @@ -447,7 +447,7 @@ void NightColorManager::slowUpdate(int targetTemp) } int nextTemp; if (m_currentTemp < targetTemp) { - nextTemp = qMin(m_currentTemp + TEMPERATURE_STEP, targetTemp); + nextTemp = std::min(m_currentTemp + TEMPERATURE_STEP, targetTemp); } else { nextTemp = std::max(m_currentTemp - TEMPERATURE_STEP, targetTemp); } diff --git a/src/tabbox/desktopchain.cpp b/src/tabbox/desktopchain.cpp index 8bde2928c8..ffa3f9f3d7 100644 --- a/src/tabbox/desktopchain.cpp +++ b/src/tabbox/desktopchain.cpp @@ -52,7 +52,7 @@ void DesktopChain::resize(uint previousSize, uint newSize) // But when desktops are removed, we may have to modify the chain a bit, // otherwise invalid desktops may show up. for (int i = 0; i < m_chain.size(); ++i) { - m_chain[i] = qMin(m_chain[i], newSize); + m_chain[i] = std::min(m_chain[i], newSize); } } } diff --git a/src/useractions.cpp b/src/useractions.cpp index 404a69a9b0..2cb241f7bd 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -932,7 +932,7 @@ void Workspace::slotIncreaseWindowOpacity() if (!m_activeWindow) { return; } - m_activeWindow->setOpacity(qMin(m_activeWindow->opacity() + 0.05, 1.0)); + m_activeWindow->setOpacity(std::min(m_activeWindow->opacity() + 0.05, 1.0)); } void Workspace::slotLowerWindowOpacity() diff --git a/src/virtualdesktops.cpp b/src/virtualdesktops.cpp index c39c6e519d..eefdd39ff4 100644 --- a/src/virtualdesktops.cpp +++ b/src/virtualdesktops.cpp @@ -496,7 +496,7 @@ void VirtualDesktopManager::removeVirtualDesktop(VirtualDesktop *desktop) } } - const uint newCurrent = qMin(oldCurrent, (uint)m_desktops.count()); + const uint newCurrent = std::min(oldCurrent, (uint)m_desktops.count()); m_current = m_desktops.at(newCurrent - 1); if (oldCurrent != newCurrent) { Q_EMIT currentChanged(oldCurrent, newCurrent); @@ -558,7 +558,7 @@ void VirtualDesktopManager::setCount(uint count) m_desktops.resize(count); if (m_current) { uint oldCurrent = current(); - uint newCurrent = qMin(oldCurrent, count); + uint newCurrent = std::min(oldCurrent, count); m_current = m_desktops.at(newCurrent - 1); if (oldCurrent != newCurrent) { Q_EMIT currentChanged(oldCurrent, newCurrent); @@ -646,7 +646,7 @@ void VirtualDesktopManager::updateRootInfo() void VirtualDesktopManager::updateLayout() { - m_rows = qMin(m_rows, count()); + m_rows = std::min(m_rows, count()); int columns = count() / m_rows; Qt::Orientation orientation = Qt::Horizontal; if (m_rootInfo) { diff --git a/src/wayland/plasmavirtualdesktop_interface.cpp b/src/wayland/plasmavirtualdesktop_interface.cpp index 23e1cd6616..1e9dcf54f7 100644 --- a/src/wayland/plasmavirtualdesktop_interface.cpp +++ b/src/wayland/plasmavirtualdesktop_interface.cpp @@ -157,7 +157,7 @@ PlasmaVirtualDesktopInterface *PlasmaVirtualDesktopManagementInterface::createDe return *i; } - const quint32 actualPosition = qMin(position, (quint32)d->desktops.count()); + const quint32 actualPosition = std::min(position, (quint32)d->desktops.count()); auto desktop = new PlasmaVirtualDesktopInterface(this); desktop->d->id = id; diff --git a/src/window.cpp b/src/window.cpp index b641d31d77..28cf7f881e 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1075,7 +1075,7 @@ void Window::setDesktop(int desktop) { const int numberOfDesktops = VirtualDesktopManager::self()->count(); if (desktop != NET::OnAllDesktops) { // Do range check - desktop = std::max(1, qMin(numberOfDesktops, desktop)); + desktop = std::max(1, std::min(numberOfDesktops, desktop)); } QVector desktops; @@ -1714,8 +1714,8 @@ void Window::checkUnrestrictedInteractiveMoveResize() int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge; // restricted move/resize - keep at least part of the titlebar always visible // how much must remain visible when moved away in that direction - left_marge = qMin(100. + borderRight(), moveResizeGeom.width()); - right_marge = qMin(100. + borderLeft(), moveResizeGeom.width()); + left_marge = std::min(100. + borderRight(), moveResizeGeom.width()); + right_marge = std::min(100. + borderLeft(), moveResizeGeom.width()); // width/height change with opaque resizing, use the initial ones titlebar_marge = initialInteractiveMoveResizeGeometry().height(); top_marge = borderBottom(); @@ -1868,8 +1868,8 @@ void Window::handleInteractiveMoveResize(int x, int y, int x_root, int y_root) } // When doing a restricted move we must always keep 100px of the titlebar // visible to allow the user to be able to move it again. - requiredPixels = qMin(100 * (transposed ? titleRect.width() : titleRect.height()), - rect.width() * rect.height()); + requiredPixels = std::min(100 * (transposed ? titleRect.width() : titleRect.height()), + rect.width() * rect.height()); return titleRect; }; @@ -2498,7 +2498,7 @@ bool Window::performMouseCommand(Options::MouseCommand cmd, const QPointF &globa break; case Options::MouseOpacityMore: if (!isDesktop()) { // No point in changing the opacity of the desktop - setOpacity(qMin(opacity() + 0.1, 1.0)); + setOpacity(std::min(opacity() + 0.1, 1.0)); } break; case Options::MouseOpacityLess: @@ -4052,13 +4052,13 @@ void Window::checkWorkspacePosition(QRectF oldGeometry, const VirtualDesktop *ol for (const QRect &r : (workspace()->*moveAreaFunc)(oldDesktop, StrutAreaRight)) { QRect rect = r & oldGeomWide; if (!rect.isEmpty()) { - oldRightMax = qMin(oldRightMax, rect.x()); + oldRightMax = std::min(oldRightMax, rect.x()); } } for (const QRect &r : (workspace()->*moveAreaFunc)(oldDesktop, StrutAreaBottom)) { QRect rect = r & oldGeomTall; if (!rect.isEmpty()) { - oldBottomMax = qMin(oldBottomMax, rect.y()); + oldBottomMax = std::min(oldBottomMax, rect.y()); } } for (const QRect &r : (workspace()->*moveAreaFunc)(oldDesktop, StrutAreaLeft)) { @@ -4078,13 +4078,13 @@ void Window::checkWorkspacePosition(QRectF oldGeometry, const VirtualDesktop *ol for (const QRect &r : workspace()->restrictedMoveArea(desktop, StrutAreaRight)) { QRect rect = r & newGeomWide; if (!rect.isEmpty()) { - rightMax = qMin(rightMax, rect.x()); + rightMax = std::min(rightMax, rect.x()); } } for (const QRect &r : workspace()->restrictedMoveArea(desktop, StrutAreaBottom)) { QRect rect = r & newGeomTall; if (!rect.isEmpty()) { - bottomMax = qMin(bottomMax, rect.y()); + bottomMax = std::min(bottomMax, rect.y()); } } for (const QRect &r : workspace()->restrictedMoveArea(desktop, StrutAreaLeft)) { @@ -4146,10 +4146,10 @@ void Window::checkWorkspacePosition(QRectF oldGeometry, const VirtualDesktop *ol newGeom.moveTop(std::max(topMax, screenArea.y())); } if (save[Right] || keep[Right]) { - newGeom.moveRight(qMin(rightMax, screenArea.right()) + 1); + newGeom.moveRight(std::min(rightMax, screenArea.right()) + 1); } if (save[Bottom] || keep[Bottom]) { - newGeom.moveBottom(qMin(bottomMax, screenArea.bottom()) + 1); + newGeom.moveBottom(std::min(bottomMax, screenArea.bottom()) + 1); } if (oldGeometry.x() >= oldLeftMax && newGeom.x() < leftMax) { diff --git a/src/workspace.cpp b/src/workspace.cpp index fd65a1e009..3f8df0a344 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1482,7 +1482,7 @@ void Workspace::slotDesktopRemoved(VirtualDesktop *desktop) if ((*it)->desktops().count() > 1) { (*it)->leaveDesktop(desktop); } else { - sendWindowToDesktop(*it, qMin(desktop->x11DesktopNumber(), VirtualDesktopManager::self()->count()), true); + sendWindowToDesktop(*it, std::min(desktop->x11DesktopNumber(), VirtualDesktopManager::self()->count()), true); } } @@ -2351,9 +2351,9 @@ QRectF Workspace::adjustClientArea(Window *window, const QRectF &area) const // They're given in virtual screen coordinates, make them affect only // their xinerama screen. strutLeft.setLeft(std::max(strutLeft.left(), screenArea.left())); - strutRight.setRight(qMin(strutRight.right(), screenArea.right())); + strutRight.setRight(std::min(strutRight.right(), screenArea.right())); strutTop.setTop(std::max(strutTop.top(), screenArea.top())); - strutBottom.setBottom(qMin(strutBottom.bottom(), screenArea.bottom())); + strutBottom.setBottom(std::min(strutBottom.bottom(), screenArea.bottom())); if (strutLeft.intersects(area)) { adjustedArea.setLeft(strutLeft.right()); diff --git a/src/x11window.cpp b/src/x11window.cpp index a4e0ae5910..ec0fbee447 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -3581,8 +3581,8 @@ QSizeF X11Window::constrainClientSize(const QSizeF &size, SizeMode mode) const min_size.setHeight(decominsize.height()); } } - w = qMin(max_size.width(), w); - h = qMin(max_size.height(), h); + w = std::min(max_size.width(), w); + h = std::min(max_size.height(), h); w = std::max(min_size.width(), w); h = std::max(min_size.height(), h); @@ -4497,7 +4497,7 @@ void X11Window::maximize(MaximizeMode mode) if (r.size() != clientArea.size()) { // to avoid off-by-one errors... if (isElectricBorderMaximizing() && r.width() < clientArea.width()) { r.moveLeft(std::max(clientArea.left(), Cursors::self()->mouse()->pos().x() - r.width() / 2)); - r.moveRight(qMin(clientArea.right(), r.right())); + r.moveRight(std::min(clientArea.right(), r.right())); } else { r.moveCenter(clientArea.center()); const bool closeHeight = r.height() > 97 * clientArea.height() / 100; diff --git a/src/xwayland/drag_wl.cpp b/src/xwayland/drag_wl.cpp index 61022f3937..232e0cfdb9 100644 --- a/src/xwayland/drag_wl.cpp +++ b/src/xwayland/drag_wl.cpp @@ -75,7 +75,7 @@ Xvisit::Xvisit(Window *target, KWaylandServer::AbstractDataSource *dataSource, D return; } xcb_atom_t *value = static_cast(xcb_get_property_value(reply)); - m_version = qMin(*value, Dnd::version()); + m_version = std::min(*value, Dnd::version()); if (m_version < 1) { // minimal version we accept is 1 doFinish();