From b3c656e93451f12daeb907320f69c190efd50e04 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 1 May 2026 11:19:47 -0700 Subject: [PATCH] hyprexpo: remove workspace number feature from PR --- hyprexpo/README.md | 5 ----- hyprexpo/main.cpp | 3 --- hyprexpo/overview.cpp | 44 +++++-------------------------------------- hyprexpo/overview.hpp | 7 ++----- 4 files changed, 7 insertions(+), 52 deletions(-) diff --git a/hyprexpo/README.md b/hyprexpo/README.md index 4bf7db4..cbc9d07 100644 --- a/hyprexpo/README.md +++ b/hyprexpo/README.md @@ -28,9 +28,6 @@ gap_size | number | gap between desktops | `5` bg_col | color | color in gaps (between desktops) | `rgb(000000)` workspace_method | [center/first] [workspace] | position of the desktops | `center current` skip_empty | boolean | whether the grid displays workspaces sequentially by id using selector "r" (`false`) or skips empty workspaces using selector "m" (`true`) | `false` -max_workspace | number | highest normal workspace to show when `skip_empty` is `false`; `0` disables the limit | `0` -show_workspace_numbers | boolean | show numeric labels for workspaces | `false` -workspace_number_color | color | color of workspace number labels | `rgb(ffffff)` gesture_distance | number | how far is the max for the gesture | `300` ### Keywords @@ -61,8 +58,6 @@ hl.config({ bg_col = "rgb(111111)", workspace_method = "center current", skip_empty = false, - show_workspace_numbers = false, - workspace_number_color = "rgb(ffffff)", gesture_distance = 300, }, }, diff --git a/hyprexpo/main.cpp b/hyprexpo/main.cpp index d601f9c..65521f4 100644 --- a/hyprexpo/main.cpp +++ b/hyprexpo/main.cpp @@ -324,9 +324,6 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { addConfigValue(makeShared("plugin:hyprexpo:bg_col", "background color", 0xFF111111)); addConfigValue(makeShared("plugin:hyprexpo:workspace_method", "workspace method", "center current")); addConfigValue(makeShared("plugin:hyprexpo:skip_empty", "skip empty workspaces", 0)); - addConfigValue(makeShared("plugin:hyprexpo:max_workspace", "maximum normal workspace shown, or 0 for unlimited", 0)); - addConfigValue(makeShared("plugin:hyprexpo:show_workspace_numbers", "show workspace numbers", 0)); - addConfigValue(makeShared("plugin:hyprexpo:workspace_number_color", "workspace number color", 0xFFFFFFFF)); addConfigValue(makeShared("plugin:hyprexpo:gesture_distance", "gesture distance", 200)); return {"hyprexpo", "A plugin for an overview", "Vaxry", "1.0"}; diff --git a/hyprexpo/overview.cpp b/hyprexpo/overview.cpp index 1dbe98f..097280c 100644 --- a/hyprexpo/overview.cpp +++ b/hyprexpo/overview.cpp @@ -66,15 +66,11 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn static const CConfigValue PGAPS("plugin:hyprexpo:gap_size"); static const CConfigValue PCOL("plugin:hyprexpo:bg_col"); static const CConfigValue PSKIP("plugin:hyprexpo:skip_empty"); - static const CConfigValue PMAXWS("plugin:hyprexpo:max_workspace"); - static const CConfigValue PSHOWNUM("plugin:hyprexpo:show_workspace_numbers"); - static const CConfigValue PNUMCOL("plugin:hyprexpo:workspace_number_color"); static const CConfigValue PMETHOD("plugin:hyprexpo:workspace_method"); - SIDE_LENGTH = *PCOLUMNS; - GAP_WIDTH = *PGAPS; - BG_COLOR = CHyprColor(*PCOL); - showWorkspaceNumbers = *PSHOWNUM; + SIDE_LENGTH = *PCOLUMNS; + GAP_WIDTH = *PGAPS; + BG_COLOR = CHyprColor(*PCOL); // process the method bool methodCenter = true; @@ -92,20 +88,9 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn images.resize(SIDE_LENGTH * SIDE_LENGTH); // r includes empty workspaces; m skips over them - const bool skipEmpty = *PSKIP; - const int64_t maxWorkspace = *PMAXWS; - std::string selector = skipEmpty ? "m" : "r"; + std::string selector = *PSKIP ? "m" : "r"; - if (!skipEmpty && maxWorkspace > 0) { - const int64_t tileCount = SIDE_LENGTH * SIDE_LENGTH; - const int64_t maxStart = std::max(1, maxWorkspace - tileCount + 1); - const int64_t startID = methodCenter ? std::clamp(methodStartID - tileCount / 2, 1, maxStart) : std::clamp(methodStartID, 1, maxStart); - - for (size_t i = 0; i < images.size(); ++i) { - const int64_t workspaceID = startID + i; - images[i].workspaceID = workspaceID <= maxWorkspace ? workspaceID : WORKSPACE_INVALID; - } - } else if (methodCenter) { + if (methodCenter) { int currentID = methodStartID; int firstID = currentID; @@ -173,16 +158,6 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn Vector2D tileRenderSize = (pMonitor->m_size - Vector2D{GAP_WIDTH * pMonitor->m_scale, GAP_WIDTH * pMonitor->m_scale} * (SIDE_LENGTH - 1)) / SIDE_LENGTH; CBox monbox{0, 0, tileSize.x * 2, tileSize.y * 2}; - if (showWorkspaceNumbers) { - const CHyprColor numberColor = CHyprColor(*PNUMCOL); - const int fontSizePx = std::max(12, (int)std::round(tileRenderSize.y * pMonitor->m_scale * 0.22)); - for (auto& image : images) { - if (image.workspaceID == WORKSPACE_INVALID) - continue; - image.labelTex = g_pHyprRenderer->renderText(std::to_string(image.workspaceID), numberColor, fontSizePx, false, "Sans Bold", tileRenderSize.x * pMonitor->m_scale); - } - } - if (!ENABLE_LOWRES) monbox = {{0, 0}, pMonitor->m_pixelSize}; @@ -516,15 +491,6 @@ void COverview::fullRender() { CRegion damage{0, 0, INT16_MAX, INT16_MAX}; auto& image = images[x + y * SIDE_LENGTH]; Render::GL::g_pHyprOpenGL->renderTextureInternal(image.fb->getTexture(), texbox, {.damage = &damage, .a = 1.0}); - - if (showWorkspaceNumbers && image.workspaceID != WORKSPACE_INVALID && image.labelTex && image.labelTex->ok()) { - const Vector2D labelSize = image.labelTex->m_size / pMonitor->m_scale; - const float margin = std::max(4.0, tileRenderSize.y * 0.05); - CBox labelBox = {x * tileRenderSize.x + x * GAPSIZE + margin, y * tileRenderSize.y + y * GAPSIZE + margin, labelSize.x, labelSize.y}; - labelBox.scale(pMonitor->m_scale).translate(pos->value()); - labelBox.round(); - Render::GL::g_pHyprOpenGL->renderTexture(image.labelTex, labelBox, {.a = 1.0}); - } } } } diff --git a/hyprexpo/overview.hpp b/hyprexpo/overview.hpp index 2aa9bae..1cbf2df 100644 --- a/hyprexpo/overview.hpp +++ b/hyprexpo/overview.hpp @@ -5,7 +5,6 @@ #include "globals.hpp" #include #include -#include #include #include #include @@ -48,7 +47,6 @@ class COverview { int64_t workspaceID = -1; PHLWORKSPACE pWorkspace; CBox box; - SP labelTex; }; private: @@ -82,9 +80,8 @@ class COverview { CHyprSignalListener touchMoveHook; CHyprSignalListener touchDownHook; - bool swipe = false; - bool swipeWasCommenced = false; - bool showWorkspaceNumbers = false; + bool swipe = false; + bool swipeWasCommenced = false; friend class COverviewPassElement; };