diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 7e7934d8..494c58e0 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -24,6 +24,10 @@ Configuration must be wrapped in a root-node. that it is not always possible to turn off client side decorations. Default is server. +** + The gap in pixels between views and output edges when using movement + actions, for example MoveToEdge. Default is 0. + # FOCUS ** [yes|no] diff --git a/docs/rc.xml b/docs/rc.xml index 0d61c7f4..7ec6c6d7 100644 --- a/docs/rc.xml +++ b/docs/rc.xml @@ -2,7 +2,7 @@ - server + 10 diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 07433301..958aedfe 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -9,6 +9,7 @@ struct rcxml { bool xdg_shell_server_side_deco; + int gap; bool focus_follow_mouse; bool raise_on_focus; char *theme_name; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index fefd9baa..f21122ef 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -167,6 +167,8 @@ entry(xmlNode *node, char *nodename, char *content) } else { rc.xdg_shell_server_side_deco = true; } + } else if (!strcmp(nodename, "gap.core")) { + rc.gap = atoi(content); } else if (!strcmp(nodename, "name.theme")) { rc.theme_name = strdup(content); } else if (!strcmp(nodename, "cornerradius.theme")) { diff --git a/src/view.c b/src/view.c index 14e53d07..6cd8e691 100644 --- a/src/view.c +++ b/src/view.c @@ -135,7 +135,6 @@ view_border(struct view *view) return border; } -#define GAP (3) void view_move_to_edge(struct view *view, const char *direction) { @@ -149,17 +148,17 @@ view_move_to_edge(struct view *view, const char *direction) int x = 0, y = 0; if (!strcasecmp(direction, "left")) { - x = usable.x + border.left + GAP; + x = usable.x + border.left + rc.gap; y = view->y; } else if (!strcasecmp(direction, "up")) { x = view->x; - y = usable.y + border.top + GAP; + y = usable.y + border.top + rc.gap; } else if (!strcasecmp(direction, "right")) { - x = usable.x + usable.width - view->w - border.right - GAP; + x = usable.x + usable.width - view->w - border.right - rc.gap; y = view->y; } else if (!strcasecmp(direction, "down")) { x = view->x; - y = usable.y + usable.height - view->h - border.bottom - GAP; + y = usable.y + usable.height - view->h - border.bottom - rc.gap; } view_move(view, x, y); }