From b2a4ea0fb3978a22a93c8a305e8575e3ec82432a Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Tue, 4 Feb 2025 11:05:48 -0500 Subject: [PATCH] squash! ssd: fix resizing on border corners and add Default to half the titlebar height. --- docs/labwc-config.5.scd | 3 ++- src/config/rcxml.c | 4 ++-- src/theme.c | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index c274a0d2..efe97239 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -580,7 +580,8 @@ extending outward from the snapped edge. The size of corner regions to which the 'TLCorner', 'TRCorner', 'BLCorner' and 'RLCorner' mousebind contexts apply, as well as the size of the border region for which mouse resizing will apply both - horizontally and vertically rather than one or the other. Default is 8. + horizontally and vertically rather than one or the other. Default is + half the titlebar height. ## KEYBOARD diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 2193336c..b3ba6439 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -1221,7 +1221,7 @@ entry(xmlNode *node, char *nodename, char *content) } else if (!strcasecmp(nodename, "drawContents.resize")) { set_bool(content, &rc.resize_draw_contents); } else if (!strcasecmp(nodename, "cornerRange.resize")) { - rc.resize_corner_range = MAX(0, atoi(content)); + rc.resize_corner_range = atoi(content); } else if (!strcasecmp(nodename, "mouseEmulation.tablet")) { set_bool(content, &rc.tablet.force_mouse_emulation); } else if (!strcasecmp(nodename, "mapToOutput.tablet")) { @@ -1494,7 +1494,7 @@ rcxml_init(void) rc.resize_indicator = LAB_RESIZE_INDICATOR_NEVER; rc.resize_draw_contents = true; - rc.resize_corner_range = 8; + rc.resize_corner_range = -1; rc.workspace_config.popuptime = INT_MIN; rc.workspace_config.min_nr_workspaces = 1; diff --git a/src/theme.c b/src/theme.c index 511bc923..51468e02 100644 --- a/src/theme.c +++ b/src/theme.c @@ -1388,6 +1388,10 @@ post_processing(struct theme *theme) rc.corner_radius = theme->titlebar_height - 1; } + if (rc.resize_corner_range < 0) { + rc.resize_corner_range = theme->titlebar_height / 2; + } + int min_button_hover_radius = MIN(theme->window_button_width, theme->window_button_height) / 2; if (theme->window_button_hover_bg_corner_radius > min_button_hover_radius) {