~sircmpwn/wio

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
4 3

[PATCH wio 0/1] Fix for selections with "negative" width or height

Details
Message ID
<160426439526.5377.7210725937700421147-0@git.sr.ht>
DKIM signature
missing
Download raw message
When using the "New" or "Resize" elements, wio crash when to cursor goes
to the left of the window's left border, or above the top border.
This patch takes the absolute value of the X and Y distance between the
top-left corner of the window and the cursor to draw the new area, thus
preventing crashes when this going the "negative way" with the cursor.

Willy Goiffon (1):
  Handle new/resize with negative cursor coordinates

 output.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

-- 
2.26.2

[PATCH wio 1/1] Handle new/resize with negative cursor coordinates

Details
Message ID
<160426439526.5377.7210725937700421147-1@git.sr.ht>
In-Reply-To
<160426439526.5377.7210725937700421147-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +11 -5
From: Willy Goiffon <dev@z3bra.org>

---
 output.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/output.c b/output.c
index 6a059f5..2e552c6 100644
--- a/output.c
+++ b/output.c
@@ -12,6 +12,9 @@
#include "server.h"
#include "view.h"

#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))

struct render_data {
	struct wlr_output *output;
	struct wlr_renderer *renderer;
@@ -269,6 +272,7 @@ static void render_layer(
}

static void output_frame(struct wl_listener *listener, void *data) {
	double x1, x2, y1, y2;
	struct wio_output *output = wl_container_of(listener, output, frame);
	struct wio_server *server = output->server;
	struct wlr_renderer *renderer = server->renderer;
@@ -350,11 +354,13 @@ static void output_frame(struct wl_listener *listener, void *data) {
		break;
	case INPUT_STATE_NEW_END:
	case INPUT_STATE_RESIZE_END:
		render_view_border(renderer, output, NULL,
			server->interactive.sx, server->interactive.sy,
			server->cursor->x - server->interactive.sx,
			server->cursor->y - server->interactive.sy,
			1);
		x1 = MIN(server->cursor->x, server->interactive.sx);
		y1 = MIN(server->cursor->y, server->interactive.sy);

		x2 = MAX(server->cursor->x, server->interactive.sx);
		y2 = MAX(server->cursor->y, server->interactive.sy);

		render_view_border(renderer, output, NULL, x1, y1, x2 - x1, y2 - y1, 1);
		break;
	default:
		break;
-- 
2.26.2

Re: [PATCH wio 1/1] Handle new/resize with negative cursor coordinates

Details
Message ID
<C6S91X5NZ6TL.97WC8MDSITJZ@taiga>
In-Reply-To
<160426439526.5377.7210725937700421147-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Can you re-do this without the macro?

Re: [PATCH v2] Handle new/resize with negative cursor coordinates

Details
Message ID
<20201102080943.GA19016@doom.z3bra.org>
In-Reply-To
<C6S91X5NZ6TL.97WC8MDSITJZ@taiga> (view parent)
DKIM signature
missing
Download raw message
Patch: +11 -5
There you go. Same patch without the macros.

---
 output.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/output.c b/output.c
index 6a059f5..c0877fe 100644
--- a/output.c
+++ b/output.c
@@ -269,6 +269,7 @@ static void render_layer(
}

static void output_frame(struct wl_listener *listener, void *data) {
	double x1, x2, y1, y2;
	struct wio_output *output = wl_container_of(listener, output, frame);
	struct wio_server *server = output->server;
	struct wlr_renderer *renderer = server->renderer;
@@ -350,11 +351,16 @@ static void output_frame(struct wl_listener *listener, void *data) {
		break;
	case INPUT_STATE_NEW_END:
	case INPUT_STATE_RESIZE_END:
		render_view_border(renderer, output, NULL,
			server->interactive.sx, server->interactive.sy,
			server->cursor->x - server->interactive.sx,
			server->cursor->y - server->interactive.sy,
			1);
		x1 = server->cursor->x < server->interactive.sx ?
			server->cursor->x : server->interactive.sx;
		y1 = server->cursor->y < server->interactive.sy ?
			server->cursor->y : server->interactive.sy;
		x2 = server->cursor->x > server->interactive.sx ?
			server->cursor->x : server->interactive.sx;
		y2 = server->cursor->y > server->interactive.sy ?
			server->cursor->y : server->interactive.sy;

		render_view_border(renderer, output, NULL, x1, y1, x2 - x1, y2 - y1, 1);
		break;
	default:
		break;
-- 
2.29.2

Re: [PATCH v2] Handle new/resize with negative cursor coordinates

Details
Message ID
<C6SXI64FLSTQ.Q36E27NGPCWM@taiga>
In-Reply-To
<20201102080943.GA19016@doom.z3bra.org> (view parent)
DKIM signature
missing
Download raw message
Can you please re-send this with git send-email? Your "There you go.
Same patch without the macros." would end up in the commit message
as-is, and you should put this into a new thread.
Reply to thread Export thread (mbox)