ssd: fix resizing on border corners and add <resize><cornerRange>

Co-authored-by: @ahesford

The direction of resizing was determined based on the hovered ssd
component (e.g. left border, top-left extent), but it caused problems when
trying to start resizing by pressing the corners of the window border; the
resizing direction was always unidirectional at bottom corners and
resizing cannot be started by pressing top corners.

This commit fixes this weirdness by determining resize directions only
based on the window geometry and the cursor position. The corner extents
are removed as they are not longer needed.

This commit also adds <resize><cornerRange> which configures the range of
corner resizing on the borders/extent.
This commit is contained in:
tokyo4j 2025-02-01 14:51:47 +09:00
parent 9a473f1848
commit e98406168d
8 changed files with 89 additions and 59 deletions

View file

@ -5,6 +5,8 @@
#include <wayland-server-core.h>
#include "common/border.h"
struct wlr_cursor;
#define SSD_EXTENDED_AREA 8
/*
@ -107,10 +109,8 @@ enum ssd_part_type ssd_button_get_type(const struct ssd_button *button);
struct view *ssd_button_get_view(const struct ssd_button *button);
/* Public SSD helpers */
enum ssd_part_type ssd_at(const struct ssd *ssd,
struct wlr_scene *scene, double lx, double ly);
enum ssd_part_type ssd_get_part_type(const struct ssd *ssd,
struct wlr_scene_node *node);
struct wlr_scene_node *node, struct wlr_cursor *cursor);
uint32_t ssd_resize_edges(enum ssd_part_type type);
bool ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate);
enum ssd_mode ssd_mode_parse(const char *mode);