diff options
author | djvs <[email protected]> | 2024-03-12 22:43:22 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-13 02:43:22 +0000 |
commit | c58fcfbce2c2e9f12cad7771555ce38b515a3389 (patch) | |
tree | c7764623a6ad6bb1bdcaed5043288913311e4366 | |
parent | 7ea555da7fff0a2457e24e06bbd34986c0755025 (diff) | |
download | Hyprland-c58fcfbce2c2e9f12cad7771555ce38b515a3389.tar.gz Hyprland-c58fcfbce2c2e9f12cad7771555ce38b515a3389.zip |
input: add general:resize_corner for manual resizing (#5090)
* Resize corner config thing
* clang-format
---------
Co-authored-by: djvs <[email protected]>
-rw-r--r-- | src/config/ConfigManager.cpp | 1 | ||||
-rw-r--r-- | src/layout/IHyprLayout.cpp | 22 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 09733596..89195a27 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -317,6 +317,7 @@ CConfigManager::CConfigManager() { m_pConfig->addConfigValue("general:hover_icon_on_border", Hyprlang::INT{1}); m_pConfig->addConfigValue("general:layout", {"dwindle"}); m_pConfig->addConfigValue("general:allow_tearing", Hyprlang::INT{0}); + m_pConfig->addConfigValue("general:resize_corner", Hyprlang::INT{0}); m_pConfig->addConfigValue("misc:disable_hyprland_logo", Hyprlang::INT{0}); m_pConfig->addConfigValue("misc:disable_splash_rendering", Hyprlang::INT{0}); diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 433434de..d2ec1ab1 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -217,7 +217,27 @@ void IHyprLayout::onBeginDragWindow() { m_vLastDragXY = m_vBeginDragXY; // get the grab corner - if (m_vBeginDragXY.x < m_vBeginDragPositionXY.x + m_vBeginDragSizeXY.x / 2.0) { + static auto RESIZECORNER = CConfigValue<Hyprlang::INT>("general:resize_corner"); + if (*RESIZECORNER != 0 && *RESIZECORNER <= 4) { + switch (*RESIZECORNER) { + case 1: + m_eGrabbedCorner = CORNER_TOPLEFT; + g_pInputManager->setCursorImageUntilUnset("nw-resize"); + break; + case 2: + m_eGrabbedCorner = CORNER_TOPRIGHT; + g_pInputManager->setCursorImageUntilUnset("ne-resize"); + break; + case 3: + m_eGrabbedCorner = CORNER_BOTTOMRIGHT; + g_pInputManager->setCursorImageUntilUnset("se-resize"); + break; + case 4: + m_eGrabbedCorner = CORNER_BOTTOMLEFT; + g_pInputManager->setCursorImageUntilUnset("sw-resize"); + break; + } + } else if (m_vBeginDragXY.x < m_vBeginDragPositionXY.x + m_vBeginDragSizeXY.x / 2.0) { if (m_vBeginDragXY.y < m_vBeginDragPositionXY.y + m_vBeginDragSizeXY.y / 2.0) { m_eGrabbedCorner = CORNER_TOPLEFT; g_pInputManager->setCursorImageUntilUnset("nw-resize"); |