diff --git a/src/core/output.cpp b/src/core/output.cpp index 483d06584c..20bf07e7bb 100644 --- a/src/core/output.cpp +++ b/src/core/output.cpp @@ -462,7 +462,7 @@ QRect Output::geometry() const return QRect(m_state.position, pixelSize() / scale()); } -QRectF Output::fractionalGeometry() const +QRectF Output::geometryF() const { return QRectF(m_state.position, QSizeF(pixelSize()) / scale()); } diff --git a/src/core/output.h b/src/core/output.h index 5876b77036..86e2e9dbb4 100644 --- a/src/core/output.h +++ b/src/core/output.h @@ -231,7 +231,7 @@ public: /** * Returns geometry of this output in device independent pixels, without rounding */ - QRectF fractionalGeometry() const; + QRectF geometryF() const; /** * Equivalent to `QRect(QPoint(0, 0), geometry().size())` diff --git a/src/rules.cpp b/src/rules.cpp index 4a91485ef9..c4b6e5848d 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -778,7 +778,7 @@ QPointF WindowRules::checkPositionSafe(QPointF pos, bool init) const } const auto outputs = workspace()->outputs(); const bool inAnyOutput = std::any_of(outputs.begin(), outputs.end(), [ret](const auto output) { - return output->fractionalGeometry().contains(ret); + return output->geometryF().contains(ret); }); if (inAnyOutput) { return ret; diff --git a/src/scene/workspacescene.cpp b/src/scene/workspacescene.cpp index 94d26e5a2b..bb37238e8b 100644 --- a/src/scene/workspacescene.cpp +++ b/src/scene/workspacescene.cpp @@ -372,7 +372,7 @@ void WorkspaceScene::postPaint() void WorkspaceScene::paint(const RenderTarget &renderTarget, const QRegion ®ion) { Output *output = kwinApp()->operationMode() == Application::OperationMode::OperationModeX11 ? nullptr : painted_screen; - RenderViewport viewport(output ? output->fractionalGeometry() : workspace()->geometry(), output ? output->scale() : 1, renderTarget); + RenderViewport viewport(output ? output->geometryF() : workspace()->geometry(), output ? output->scale() : 1, renderTarget); m_renderer->beginFrame(renderTarget, viewport); diff --git a/src/tiles/tile.cpp b/src/tiles/tile.cpp index 4a2ef0551c..cfe72d539d 100644 --- a/src/tiles/tile.cpp +++ b/src/tiles/tile.cpp @@ -83,7 +83,7 @@ void Tile::setGeometryFromWindow(const QRectF &geom) void Tile::setGeometryFromAbsolute(const QRectF &geom) { - const QRectF outGeom = m_tiling->output()->fractionalGeometry(); + const QRectF outGeom = m_tiling->output()->geometryF(); const QRectF relGeom((geom.x() - outGeom.x()) / outGeom.width(), (geom.y() - outGeom.y()) / outGeom.height(), geom.width() / outGeom.width(), @@ -120,7 +120,7 @@ QRectF Tile::relativeGeometry() const QRectF Tile::absoluteGeometry() const { - const QRectF geom = m_tiling->output()->fractionalGeometry(); + const QRectF geom = m_tiling->output()->geometryF(); return QRectF(std::round(geom.x() + m_relativeGeometry.x() * geom.width()), std::round(geom.y() + m_relativeGeometry.y() * geom.height()), std::round(m_relativeGeometry.width() * geom.width()), @@ -129,7 +129,7 @@ QRectF Tile::absoluteGeometry() const QRectF Tile::absoluteGeometryInScreen() const { - const QRectF geom = m_tiling->output()->fractionalGeometry(); + const QRectF geom = m_tiling->output()->geometryF(); return QRectF(std::round(m_relativeGeometry.x() * geom.width()), std::round(m_relativeGeometry.y() * geom.height()), std::round(m_relativeGeometry.width() * geom.width()), @@ -208,7 +208,7 @@ void Tile::resizeFromGravity(Gravity gravity, int x_root, int y_root) return; } - const QRectF outGeom = m_tiling->output()->fractionalGeometry(); + const QRectF outGeom = m_tiling->output()->geometryF(); const QPointF relativePos = QPointF((x_root - outGeom.x()) / outGeom.width(), (y_root - outGeom.y()) / outGeom.height()); QRectF newGeom = m_relativeGeometry; @@ -251,7 +251,7 @@ void Tile::resizeByPixels(qreal delta, Qt::Edge edge) return; } - const auto outGeom = m_tiling->output()->fractionalGeometry(); + const auto outGeom = m_tiling->output()->geometryF(); auto newGeom = m_relativeGeometry; switch (edge) { diff --git a/src/tiles/tilemanager.cpp b/src/tiles/tilemanager.cpp index 986e0e8efc..fff0a0febf 100644 --- a/src/tiles/tilemanager.cpp +++ b/src/tiles/tilemanager.cpp @@ -96,7 +96,7 @@ Tile *TileManager::bestTileForPosition(const QPointF &pos) if (!exclusiveContains(r, pos)) { // This gives a strong preference for tiles that contain the point // still base on distance though as floating tiles can overlap - distance += m_output->fractionalGeometry().width(); + distance += m_output->geometryF().width(); } if (distance < minimumDistance) { minimumDistance = distance; diff --git a/src/wayland/xdgoutput_v1.cpp b/src/wayland/xdgoutput_v1.cpp index 56a83f5e1a..850af72623 100644 --- a/src/wayland/xdgoutput_v1.cpp +++ b/src/wayland/xdgoutput_v1.cpp @@ -108,8 +108,8 @@ XdgOutputV1Interface::XdgOutputV1Interface(OutputInterface *output) name = handle->name(); description = handle->description(); - pos = handle->fractionalGeometry().topLeft(); - size = handle->fractionalGeometry().size(); + pos = handle->geometryF().topLeft(); + size = handle->geometryF().size(); connect(handle, &Output::geometryChanged, this, &XdgOutputV1Interface::update); } @@ -120,7 +120,7 @@ void XdgOutputV1Interface::update() return; } - const QRectF geometry = output->handle()->fractionalGeometry(); + const QRectF geometry = output->handle()->geometryF(); const auto resources = resourceMap(); if (pos != geometry.topLeft()) { diff --git a/src/workspace.cpp b/src/workspace.cpp index bbd8c3b2e4..03782a6f61 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -2306,7 +2306,7 @@ void Workspace::updateClientArea() workAreas[desktop] = m_geometry; for (const Output *output : std::as_const(m_outputs)) { - screenAreas[desktop][output] = output->fractionalGeometry(); + screenAreas[desktop][output] = output->geometryF(); } } @@ -2356,7 +2356,7 @@ void Workspace::updateClientArea() } restrictedAreas[vd] += strutRegion; for (Output *output : std::as_const(m_outputs)) { - const auto geo = screenAreas[vd][output].intersected(adjustClientArea(window, output->fractionalGeometry())); + const auto geo = screenAreas[vd][output].intersected(adjustClientArea(window, output->geometryF())); // ignore the geometry if it results in the screen getting removed completely if (!geo.isEmpty()) { screenAreas[vd][output] = geo; @@ -2407,12 +2407,12 @@ QRectF Workspace::clientArea(clientAreaOption opt, const Output *output, const V return *outputIt; } } - return output->fractionalGeometry(); + return output->geometryF(); case MaximizeFullArea: case FullScreenArea: case MovementArea: case ScreenArea: - return output->fractionalGeometry(); + return output->geometryF(); case WorkArea: return m_workAreas.value(desktop, m_geometry); case FullArea: @@ -2518,7 +2518,7 @@ Output *Workspace::xineramaIndexToOutput(int index) const const QRect needle(infos[index].x_org, infos[index].y_org, infos[index].width, infos[index].height); for (Output *output : std::as_const(m_outputs)) { - if (Xcb::toXNative(output->fractionalGeometry()) == needle) { + if (Xcb::toXNative(output->geometryF()) == needle) { return output; } } diff --git a/src/xwayland/xwayland.cpp b/src/xwayland/xwayland.cpp index 3a6d020d65..e90bae34e6 100644 --- a/src/xwayland/xwayland.cpp +++ b/src/xwayland/xwayland.cpp @@ -593,7 +593,7 @@ void Xwayland::updatePrimary() } Output *const primaryOutput = workspace()->outputOrder().front(); - const QRect primaryOutputGeometry = Xcb::toXNative(primaryOutput->fractionalGeometry()); + const QRect primaryOutputGeometry = Xcb::toXNative(primaryOutput->geometryF()); for (int i = 0; i < resources->num_crtcs; ++i) { Xcb::RandR::CrtcInfo crtcInfo(crtcs[i], resources->config_timestamp); const QRect geometry = crtcInfo.rect();