mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 14:42:01 -07:00
input: add general:resize_corner for manual resizing (#5090)
* Resize corner config thing * clang-format --------- Co-authored-by: djvs <djvs@users.noreply.github.com>
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user