~mil/lisgd

2087fbe090509cfbe4d61ed1fccad886b14f0060 — Willow Barraco 10 months ago b3b96fa master 0.4.0
Add a -s to scale the edge sizes

With some very HiDPI screen, it is hard to trigger edge triggers.
3 files changed, 17 insertions(+), 8 deletions(-)

M config.def.h
M lisgd.1
M lisgd.c
M config.def.h => config.def.h +1 -0
@@ 20,6 20,7 @@ double edgesizeleft = 50.0;
double edgesizetop = 50.0;
double edgesizeright = 50.0;
double edgesizebottom = 50.0;
double edgessizecaling = 1.0;
char *device = "/dev/input/touchscreen";

//Gestures can also be specified interactively from the command line using -g

M lisgd.1 => lisgd.1 +5 -0
@@ 97,6 97,11 @@ and either the DISPLAY or WAYLAND_DISPLAY env var is set, X/Wayland
dynamic screen geometry detection will be used instead.

.TP
.BR \-s ", " \-s\ edgessizecaling\fR
Scale the edge sizes with this value. It is very usefull with very hidpi screens,
to help detecting edge gestures.

.TP
.BR \-v \fR
Enables verbose mode which prints debugging messages.


M lisgd.c => lisgd.c +11 -8
@@ 178,22 178,22 @@ Edge
gesturecalculateedge(double x0, double y0, double x1, double y1) {
		Edge horizontal = EdgeNone;
		Edge vertical = EdgeNone;
		if (x0 <= edgesizeleft) {
		if (x0 <= edgesizeleft * edgessizecaling) {
			horizontal = EdgeLeft;
		} else if (x0 >= screenwidth - edgesizeright) {
		} else if (x0 >= screenwidth - edgesizeright * edgessizecaling) {
			horizontal = EdgeRight;
		} else if (x1 <= edgesizeleft) {
		} else if (x1 <= edgesizeleft * edgessizecaling) {
			horizontal = EdgeLeft;
		} else if (x1 >= screenwidth - edgesizeright) {
		} else if (x1 >= screenwidth - edgesizeright * edgessizecaling) {
			horizontal = EdgeRight;
		}
		if (y0 <= edgesizetop) {
		if (y0 <= edgesizetop * edgessizecaling) {
			vertical = EdgeTop;
		} else if (y0 >= screenheight - edgesizebottom) {
		} else if (y0 >= screenheight - edgesizebottom * edgessizecaling) {
			vertical = EdgeBottom;
		} else if (y1 <= edgesizetop) {
		} else if (y1 <= edgesizetop * edgessizecaling) {
			vertical = EdgeTop;
		} else if (y1 >= screenheight - edgesizebottom) {
		} else if (y1 >= screenheight - edgesizebottom * edgessizecaling) {
			vertical = EdgeBottom;
		}
		if (horizontal == EdgeLeft && vertical == EdgeTop) {


@@ 553,6 553,9 @@ main(int argc, char *argv[])
		} else if (!strcmp(argv[i], "-w")) {
			if (i == argc - 1) die("option -w expects a value");
			screenwidth = atoi(argv[++i]);
		} else if (!strcmp(argv[i], "-s")) {
			if (i == argc - 1) die("option -s expects a value");
			edgessizecaling = atof(argv[++i]);
		} else if (!strcmp(argv[i], "-g")) {
			if (i == argc - 1) die("option -g expects a value");
			gestsarrlen++;